X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 6DBE5D1B507 for ; Fri, 26 Sep 2003 13:51:03 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 15063-09 for ; Fri, 26 Sep 2003 10:50:56 -0300 (ADT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id 21DADD1B4F1 for ; Fri, 26 Sep 2003 10:50:52 -0300 (ADT) Received: (qmail 24590 invoked by uid 500); 26 Sep 2003 13:57:57 -0000 Date: Fri, 26 Sep 2003 08:57:57 -0500 From: Bruno Wolff III To: Jodi Kanter Cc: Postgres Admin List Subject: Re: table constraints vs column Message-ID: <20030926135757.GA24359@wolff.to> Mail-Followup-To: Jodi Kanter , Postgres Admin List References: <3F7432AA.9060805@virginia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F7432AA.9060805@virginia.edu> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/435 X-Sequence-Number: 10523 On Fri, Sep 26, 2003 at 08:35:54 -0400, Jodi Kanter wrote: > Is there any argument to support using table constraints over column > constraints in a situation where there are no PKs or FK references that > are composed of more than one column? Functionally they should be the same, so I think it is more of a style issue. > Is the automatic PK index generated on for table constraints or for either? > Jodi Foreign key references do not create indexes. There already needs to be an existing unique index (primary key will generate a unique index) on the table being referenced or the constraint creation will fail. Optionally you may also want to create an index on the referencing columns if you will be doing lots of deletes (and I think updates before 7.4) on the referenced table.