Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Preferred method in creating primary key

Re: Preferred method in creating primary key

From: Jack Wang <nospam_at_nospam.com>
Date: Wed, 13 Aug 2003 18:21:33 GMT
Message-ID: <Nkv_a.4641$zE1.3955@edtnps84>


Hi Norm,

The second step "create index" seems redundant as Oracle will create unique index for non-deferrable pk and nonunique index for deferrable pk, respectively.

Cheers,
Jack

"Norman Dunbar" <Norman.Dunbar_at_lfs.co.uk> wrote in message news:E2F6A70FE45242488C865C3BC1245DA70410C4B7_at_lnewton.leeds.lfs.co.uk...
> Hi Jack,
>
> my favourite method is this :
>
> create table blah (.....)
> create index blah_pk on blah (...)
> alter table blah add constraint blah_pk primary key (...) deferrable
> initially immediate;
>
> Now I can drop my constraint without losing my index.
>
> You mentioned that your index was hidden when you dropped or disabled
> the constraint - it isn't hidden, it is quietly dropped. That's what it
> 'comes back' in the default tablespace.
>
> Cheers,
> Norm.
>
> -------------------------------------
> Norman Dunbar
> Database/Unix administrator
> Lynx Financial Systems Ltd.
> mailto:Norman.Dunbar_at_LFS.co.uk
> Tel: 0113 289 6265
> Fax: 0113 289 3146
> URL: http://www.Lynx-FS.com
> -------------------------------------
>
Received on Wed Aug 13 2003 - 13:21:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US