Received: from bologna.nettuno.it (bologna.nettuno.it [193.43.2.1]) by hub.org (8.9.1/8.9.1) with ESMTP id FAA08278; Thu, 29 Oct 1998 05:36:37 -0500 (EST) (envelope-from jose@sferacarta.com) Received: from proxy.sferacarta.com (mail@sfcabop1.nettuno.it [193.207.10.213]) by bologna.nettuno.it (8.8.6/8.8.6/NETTuno 3.1) with ESMTP id LAA09936; Thu, 29 Oct 1998 11:33:38 +0100 (MET) Received: from rosso.sferacarta.com (sferacarta.com) [10.20.30.5] by proxy.sferacarta.com with esmtp (Exim 1.92 #1 (Debian)) id 0zYr92-0000Wx-00; Thu, 29 Oct 1998 12:25:40 +0000 Message-ID: <363843C3.D50853FF@sferacarta.com> Date: Thu, 29 Oct 1998 11:30:27 +0100 From: "Jose' Soares" X-Mailer: Mozilla 4.05 [en] (Win95; I) 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 Hi Constantin, This is a syntax problem, there are two kinds of constraints (table and column constraints) and both of them must be defined inside ( ) not outside: create table emppay ( name text not null check (name <> ''), --column constraint definition wage float4 default 10.00, constraint empcon check (wage > 5.30 and wage <= 30.00) --table constraint definition ); CREATE Jose' Constantin Teodorescu wrote: > > I am planning a new release to PgAccess (mainly bug fixes) and 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 ! > > Please reply as soon as possible, so I could release this version prior > to 6.4 Pg release. > > 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" >