X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3EBC6329F46 for ; Tue, 28 Sep 2004 23:36:58 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 03687-03 for ; Tue, 28 Sep 2004 22:36:49 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id 89F84329E6B for ; Tue, 28 Sep 2004 23:36:41 +0100 (BST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id i8SMaUMu020208; Tue, 28 Sep 2004 18:36:30 -0400 (EDT) To: mailreg@numerixtechnology.de Cc: pgsql-sql Subject: Re: CHECK col A not NULL if col B='x' In-reply-to: <41597CD2.1030602@numerixtechnology.de> References: <41596EDA.4030909@numerixtechnology.de> <200409281112.02986.martin@bugs.unl.edu.ar> <41597CD2.1030602@numerixtechnology.de> Comments: In-reply-to T E Schmitz message dated "Tue, 28 Sep 2004 16:01:38 +0100" Date: Tue, 28 Sep 2004 18:36:30 -0400 Message-ID: <20207.1096410990@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/251 X-Sequence-Number: 19097 T E Schmitz 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