pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: mailreg@numerixtechnology.de
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: CHECK col A not NULL if col B='x'
Date: Tue, 28 Sep 2004 18:36:30 -0400
Message-ID: <20207.1096410990@sss.pgh.pa.us> (raw)
In-Reply-To: <41597CD2.1030602@numerixtechnology.de>
References: <41596EDA.4030909@numerixtechnology.de>
	<200409281112.02986.martin@bugs.unl.edu.ar>
	<41597CD2.1030602@numerixtechnology.de>

T E Schmitz <mailreg@numerixtechnology.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



view thread (6+ messages)

Message-ID: <20207.1096410990@sss.pgh.pa.us>
Permalink:  ../20207.1096410990@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20207.1096410990@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, mailreg@numerixtechnology.de
  Subject: Re: CHECK col A not NULL if col B='x'
  In-Reply-To: <20207.1096410990@sss.pgh.pa.us>

* 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