pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Jodi Kanter <jkanter@virginia.edu>
Cc: Postgres Admin List <pgsql-admin@postgresql.org>
Subject: Re: table constraints vs column
Date: Fri, 26 Sep 2003 08:57:57 -0500
Message-ID: <20030926135757.GA24359@wolff.to> (raw)
In-Reply-To: <3F7432AA.9060805@virginia.edu>
References: <3F7432AA.9060805@virginia.edu>

On Fri, Sep 26, 2003 at 08:35:54 -0400,
  Jodi Kanter <jkanter@virginia.edu> 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.



view thread (2+ messages)

Message-ID: <20030926135757.GA24359@wolff.to>
Permalink:  ../20030926135757.GA24359@wolff.to/
Also on:    postgresql.org/message-id/20030926135757.GA24359@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: bruno@wolff.to, jkanter@virginia.edu
  Subject: Re: table constraints vs column
  In-Reply-To: <20030926135757.GA24359@wolff.to>
  References: <3F7432AA.9060805@virginia.edu> <20030926135757.GA24359@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox