Re: table vs. column constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tim Wilson <wilson(at)isis(dot)visi(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: table vs. column constraints
Date: 2002-04-08 20:09:34
Message-ID: 23157.1018296574@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Tim Wilson <wilson(at)isis(dot)visi(dot)com> writes:
> I'm having trouble understanding when to use table constraints vs.
> column ones.

There's no functional difference --- if you have a constraint that only
involves one column, you can write it either way. Do what seems easier
to understand.

I believe pg_dump will dump all constraints as table constraints, so in
the long run it may not make any difference anyway ;-)

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Juliet May 2002-04-08 21:43:30 [Novice] questions on pg_hba.conf and stopping postmaster in cygwin
Previous Message Tom Lane 2002-04-08 19:20:39 Re: How to turn off referential integrity