Re: CHECK col A not NULL if col B='x'

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: mailreg(at)numerixtechnology(dot)de
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: CHECK col A not NULL if col B='x'
Date: 2004-09-28 22:36:30
Message-ID: 20207.1096410990@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

T E Schmitz <mailreg(at)numerixtechnology(dot)de> writes:
> I noticed a table constraint can be added via ALTER TABLE. Is it correct
> that a column constraint cannot be added via the ALTER TABLE other than
> by dropping and adding the column? (I am using psql 7.4.2.)

There is no difference between table and column constraints in PG. Just
write it as a table constraint in ALTER TABLE.

regards, tom lane

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleus Mantzios 2004-09-29 05:36:07 Re: FOREIGN KEY and AccessExclusiveLock
Previous Message Paul Thomas 2004-09-28 20:39:00 Re: Doubt