Re: [INTERFACES] Does "constraint" and "check" work in 6.3.2 ?

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Constantin Teodorescu <teo(at)flex(dot)ro>
Cc: PostgreSQL general <pgsql-general(at)postgreSQL(dot)org>, PostgreSQL Interfaces <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] Does "constraint" and "check" work in 6.3.2 ?
Date: 1998-10-29 03:32:15
Message-ID: 3637E1BF.C9C56EE0@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

> 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Taral 1998-10-29 05:31:51 RE: [GENERAL] Solaris Compile problems
Previous Message The Hermit Hacker 1998-10-29 02:23:48 Re: [GENERAL] Solaris Compile problems

Browse pgsql-interfaces by date

  From Date Subject
Next Message Murad Nayal 1998-10-29 05:54:31 Re: [INTERFACES] [Fwd: postgresql JDBC driver question]
Previous Message Peter T Mount 1998-10-28 22:05:35 Re: [INTERFACES] [Fwd: postgresql JDBC driver question]