From: | Rob Sargent <robjsargent(at)gmail(dot)com> |
---|---|
To: | "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com> |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: Avoiding "will create implicit index" NOTICE |
Date: | 2009-06-11 16:05:39 |
Message-ID: | 4A312B53.7010000@gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
A. Kretschmer wrote:
> In response to Bryce Nesbitt :
>
>> Hmm, no. I still get the NOTICE. How can I create the primary key
>> without triggering a NOTICE?
>>
>
> Sure, set client_min_messages='...'
>
> test=*# create table bla(id int primary key);
> NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "bla_pkey" for table "bla"
> CREATE TABLE
> test=*# rollback;
> ROLLBACK
> test=# set client_min_messages='warning';
> SET
> test=*# create table bla(id int primary key);
> CREATE TABLE
> test=*#
>
>
> Andreas
>
Funny thing is I'm using set client_min_message in my own scripts!
Also was assuming OP was in a scripting/temp-table mode and that the
notion of explicit primary key (vs. simply stating the index) isn't of
great value in that realm I don't think.
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Rosenberg | 2009-06-11 20:16:12 | polymorphic function in 7.4 vs. 8.3 |
Previous Message | Pavel Stehule | 2009-06-11 08:54:39 | Re: dynamic columns in a query |