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.