X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 1F4EE9DCA75 for ; Wed, 11 Jan 2006 23:49:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 70472-05 for ; Wed, 11 Jan 2006 23:49:27 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from imsm057dat.netvigator.com (imsm057.netvigator.com [218.102.48.210]) by postgresql.org (Postfix) with ESMTP id 178129DCA77 for ; Wed, 11 Jan 2006 23:49:19 -0400 (AST) Received: from n2.netvigator.com ([218.103.176.100]) by imsm057dat.netvigator.com (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060112034923.NIKX14795.imsm057dat.netvigator.com@n2.netvigator.com> for ; Thu, 12 Jan 2006 11:49:23 +0800 Received: from n2.netvigator.com ([127.0.0.1]) by [127.0.0.1] with ESMTP (SpamPal v1.591) sender ; 12 Jan 2006 11:49:23 +???? Message-Id: <6.2.1.2.0.20060112103712.0529cdd0@localhost> X-Mailer: QUALCOMM Windows Eudora Version 6.2.1.2 Date: Thu, 12 Jan 2006 11:49:16 +0800 To: pgsql-performance@postgresql.org From: K C Lau Subject: Re: indexes on primary and foreign keys In-Reply-To: References: <1b8a973c0601111438m3e0b1cc0hf9c387a4a1d6791d@mail.gmail.com> <20060111232157.GA88829@winnie.fuhr.org> <6.2.1.2.0.20060112083033.02bb74c8@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.2 required=5 tests=[AWL=-0.240, DNS_FROM_RFC_POST=1.44] X-Spam-Score: 1.2 X-Spam-Level: * X-Archive-Number: 200601/146 X-Sequence-Number: 16624 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.