Re: Avoiding "will create implicit index" NOTICE
От | Bryce Nesbitt |
---|---|
Тема | Re: Avoiding "will create implicit index" NOTICE |
Дата | |
Msg-id | 4A30AC42.1060709@obviously.com обсуждение исходный текст |
Ответ на | Re: Avoiding "will create implicit index" NOTICE (Bryce Nesbitt <bryce2@obviously.com>) |
Ответы |
Re: Avoiding "will create implicit index" NOTICE
|
Список | pgsql-sql |
Hmm, no. I still get the NOTICE. How can I create the primary key without triggering a NOTICE? bnesbitt=> create unique index test_5_pkey on test_5 (userid, site_key); CREATE INDEX bnesbitt=> alter table test_5 add primary key (userid, site_key); NOTICE: ALTER TABLE / ADD PRIMARY KEY will create implicit index "test_5_pkey1" for table "test_5" ALTER TABLE bnesbitt=> \d test_5 Table "public.test_5" +-------------------+---------+-----------+ | Column | Type | Modifiers | +-------------------+---------+-----------+ | userid | integer | not null | | site_key | integer | not null | | ranking_365 | integer | default 0 | | downloads_total | integer | default 0 | | ranking_total | integer | default 0 | +-------------------+---------+-----------+ Indexes: "test_5_pkey1" PRIMARY KEY, btree (userid, site_key) "test_5_pkey" UNIQUE, btree (userid, site_key) Foreign-key constraints: "test_5_site_key_fkey" FOREIGN KEY (site_key) REFERENCES contexts(context_key) ON DELETE CASCADE "test_5_userid_fkey" FOREIGN KEY (userid) REFERENCES users(userid) ON DELETE CASCADE Bryce Nesbitt wrote: > Thanks, that's good. > > Rob Sargent wrote: > >> create table junk_six (foo int) >> create unique index junk_six_id on junk_six(foo) >> > >
В списке pgsql-sql по дате отправления: