pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Does "constraint" and "check" work in 6.3.2 ?
3+ messages / 3 participants
[nested] [flat]

* Does "constraint" and "check" work in 6.3.2 ?
@ 1998-10-28 18:46 Constantin Teodorescu <teo@flex.ro>
  1998-10-29 03:32 ` Re: [INTERFACES] Does "constraint" and "check" work in 6.3.2 ? Thomas G. Lockhart <lockhart@alumni.caltech.edu>
  1998-10-29 10:30 ` Re: [INTERFACES] Does "constraint" and "check" work in 6.3.2 ? Jose' Soares <jose@sferacarta.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Constantin Teodorescu @ 1998-10-28 18:46 UTC (permalink / raw)
  To: PostgreSQL general <pgsql-general@postgreSQL.org>; pgsql-interfaces

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"

???!????

-- 
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] Does "constraint" and "check" work in 6.3.2 ?
  1998-10-28 18:46 Does "constraint" and "check" work in 6.3.2 ? Constantin Teodorescu <teo@flex.ro>
@ 1998-10-29 03:32 ` Thomas G. Lockhart <lockhart@alumni.caltech.edu>
  1 sibling, 0 replies; 3+ messages in thread

From: Thomas G. Lockhart @ 1998-10-29 03:32 UTC (permalink / raw)
  To: Constantin Teodorescu <teo@flex.ro>; +Cc: PostgreSQL general <pgsql-general@postgreSQL.org>; 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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: [INTERFACES] Does "constraint" and "check" work in 6.3.2 ?
  1998-10-28 18:46 Does "constraint" and "check" work in 6.3.2 ? Constantin Teodorescu <teo@flex.ro>
@ 1998-10-29 10:30 ` Jose' Soares <jose@sferacarta.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Jose' Soares @ 1998-10-29 10:30 UTC (permalink / raw)
  To: Constantin Teodorescu <teo@flex.ro>; +Cc: PostgreSQL general <pgsql-general@postgresql.org>; pgsql-interfaces

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"
>



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~1998-10-29 10:30 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1998-10-28 18:46 Does "constraint" and "check" work in 6.3.2 ? Constantin Teodorescu <teo@flex.ro>
1998-10-29 03:32 ` Thomas G. Lockhart <lockhart@alumni.caltech.edu>
1998-10-29 10:30 ` Jose' Soares <jose@sferacarta.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox