Re: Avoiding "will create implicit index" NOTICE - Mailing list pgsql-sql

From Bryce Nesbitt
Subject Re: Avoiding "will create implicit index" NOTICE
Date
Msg-id 4A30AC42.1060709@obviously.com
Whole thread Raw
In response to Re: Avoiding "will create implicit index" NOTICE  (Bryce Nesbitt <bryce2@obviously.com>)
Responses Re: Avoiding "will create implicit index" NOTICE  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
List 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 by date:

Previous
From: Bryce Nesbitt
Date:
Subject: Re: Avoiding "will create implicit index" NOTICE
Next
From: "A. Kretschmer"
Date:
Subject: Re: Avoiding "will create implicit index" NOTICE