From jkanter@virginia.edu Fri Sep 26 12:25:41 2003 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 40700D1B4EC for ; Fri, 26 Sep 2003 12:25:41 +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 95550-10 for ; Fri, 26 Sep 2003 09:25:12 -0300 (ADT) Received: from mailhub.mail.Virginia.EDU (mail.Virginia.EDU [128.143.2.9]) by svr1.postgresql.org (Postfix) with ESMTP id 95A15D1B4EB for ; Fri, 26 Sep 2003 09:25:08 -0300 (ADT) Received: from smtp.mail.Virginia.EDU (smtp.mail.Virginia.EDU [128.143.22.52]) by mailhub.mail.Virginia.EDU (Postfix) with ESMTP id 187ED8D7FB for ; Fri, 26 Sep 2003 08:25:12 -0400 (EDT) Received: from virginia.edu (d-137-133-128.bootp.Virginia.EDU [137.54.133.128]) by smtp.mail.Virginia.EDU (8.11.7/8.11.6) with ESMTP id h8QCPBl31288 for ; Fri, 26 Sep 2003 08:25:11 -0400 Message-ID: <3F7432AA.9060805@virginia.edu> Date: Fri, 26 Sep 2003 08:35:54 -0400 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 To: Postgres Admin List Subject: table constraints vs column Content-Type: multipart/alternative; boundary="------------080709080109020608020207" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/433 X-Sequence-Number: 10521 --------------080709080109020608020207 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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? Is the automatic PK index generated on for table constraints or for either? Jodi -- _______________________________ Jodi L Kanter BioInformatics Database Administrator University of Virginia (434) 924-2846 jkanter@virginia.edu --------------080709080109020608020207 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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?
Is the automatic PK index generated on for table constraints or for either?
Jodi
--
________________________________

_______________________________
Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu


 

 

 

--------------080709080109020608020207-- From bruno@wolff.to Fri Sep 26 13:51:03 2003 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.