Received: from golem.jpl.nasa.gov (IDENT:root@hectic-2.jpl.nasa.gov [128.149.68.204]) by hub.org (8.9.1/8.9.1) with ESMTP id WAA16628; Wed, 28 Oct 1998 22:30:45 -0500 (EST) (envelope-from lockhart@alumni.caltech.edu) Received: from alumni.caltech.edu (localhost [127.0.0.1]) by golem.jpl.nasa.gov (8.8.5/8.8.5) with ESMTP id DAA28863; Thu, 29 Oct 1998 03:32:16 GMT Sender: tgl@mythos.jpl.nasa.gov Message-ID: <3637E1BF.C9C56EE0@alumni.caltech.edu> Date: Thu, 29 Oct 1998 03:32:15 +0000 From: "Thomas G. Lockhart" Organization: Caltech/JPL X-Mailer: Mozilla 4.07 [en] (X11; I; Linux 2.0.30 i686) MIME-Version: 1.0 To: Constantin Teodorescu CC: PostgreSQL general , PostgreSQL Interfaces Subject: Re: [INTERFACES] Does "constraint" and "check" work in 6.3.2 ? References: <36376670.E573456E@flex.ro> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > I'm wondering if "constraint" and "check" are working ! > I am using PostgreSQL 6.3.2 and this example from man create_table is > not working for me ! > testdb=> create table emppay (name text not null, wage float4 default > 10.00) constraint empcon check (wage > 5.30 and wage <= 30.00), check > (name <> ''); > ERROR: parser: parse error at or near "constraint" The syntax changed slightly (in v6.3 I recall) to conform to SQL92. The constraint clauses moved to inside the column declaration parens. Try: create table emppay ( name text not null, wage float4 default 10.00, constraint empcon check (wage > 5.30 and wage <= 30.00), check (name <> '') ); - Tom