Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Preferred method in creating primary key
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
![]() |
![]() |