Re: table constraints vs column

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Jodi Kanter <jkanter(at)virginia(dot)edu>
Cc: Postgres Admin List <pgsql-admin(at)postgresql(dot)org>
Subject: Re: table constraints vs column
Date: 2003-09-26 13:57:57
Message-ID: 20030926135757.GA24359@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message scott.marlowe 2003-09-26 14:07:30 Re: Fw: Case Insensitive Test
Previous Message Lamar Owen 2003-09-26 13:22:26 Re: [ADMIN] postgres 6.2 vacuum