Re: indexes on primary and foreign keys - Mailing list pgsql-performance

From K C Lau
Subject Re: indexes on primary and foreign keys
Date
Msg-id 6.2.1.2.0.20060112103712.0529cdd0@localhost
Whole thread Raw
In response to Re: indexes on primary and foreign keys  (Michael Glaesemann <grzm@myrealbox.com>)
Responses Re: indexes on primary and foreign keys
List pgsql-performance
At 09:26 06/01/12, you wrote:

>On Jan 12, 2006, at 9:36 , K C Lau wrote:
>
>>>NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
>>>"cities_pkey" for table "cities"
>>
>>Is there a way to suppress this notice when I create tables in a
>>script?
>
>Set[1] your log_min_messages to WARNING or higher[2].
>
>[1](http://www.postgresql.org/docs/current/interactive/sql-set.html)
>[2](http://www.postgresql.org/docs/current/interactive/runtime-config-logging.html#RUNTIME-CONFIG-LOGGING-WHEN)
>
>Michael Glaesemann
>grzm myrealbox com

Thanks. The side effect is that it would suppress other notices which might
be useful.

I was looking for a way to suppress the notice within the CREATE TABLE
statement but could not.
I noticed that when I specify a constraint name for the primary key, it
would create an implicit index with the constraint name. So may be if the
optional constraint name is specified by the user, then the notice can be
suppressed. Indeed the manual already says that the index will be
automatically created.

BTW, there's an extra space in link[2] above which I have removed.

Best regards,
KC.


pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Extremely irregular query performance
Next
From: Robert Creager
Date:
Subject: Re: Index isn't used during a join.