Excerpt fro pgsql 8.4 docs : ” […]a column constraint is only a notational convenience for use when the constraint only affects one column.”
How is this valid sql then?
DROP TABLE IF EXISTS test;
CREATE TABLE test(
id integer CONSTRAINT PK_test PRIMARY KEY CONSTRAINT nenull NOT NULL CHECK (id3>=id2)
--the check constraint affects two columns none of which is id
,id2 integer
, id3 integer
);
the excerpt seems to apply only to PRIMARY KEY and FOREIGN KEY constraints which should only affect the column on the same line where the constraints are declarated as Catcall has stated
Elsewhere in the docs . . .