Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-sql by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group