> 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