Re: changes to table creation syntax in 7.1.2? - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: changes to table creation syntax in 7.1.2?
Date
Msg-id Pine.BSF.4.21.0108291122540.48187-100000@megazone23.bigpanda.com
Whole thread Raw
In response to changes to table creation syntax in 7.1.2?  ("Jayson Callaway" <jayson.callaway@iona.com>)
List pgsql-sql
On Wed, 22 Aug 2001, Jayson Callaway wrote:

> In postgres 7.0.x I had some working code that lookes something like:
> 
> CREATE TABLE category
> (
>     uid int4 PRIMARY KEY,
>     description text NOT NULL,
>     parent int4 NULL REFERENCES category(uid)
> )
> 
> After upgrading to postgres 7.1.2 however this syntax is not accepted
> anymore. I receive an error that says it can not create the reference
> because the table category does not exist.
> 
> How do I setup this type of reference structure in 7.1.2? Did the syntax
> change?

Hmm, that's odd, that should have still worked (and does work on
reasonably current sources).  I'd have thought we'd have seen reports
before now if this syntax got broken, but maybe not.  Only other thing I
could think of would be if the table name was a double quoted name of
mixed case and not such in the references constraint.

As an interim solution you can use alter table to add the references
constraint after the table creation.



pgsql-sql by date:

Previous
From: "Jayson Callaway"
Date:
Subject: changes to table creation syntax in 7.1.2?
Next
From: Jason Earl
Date:
Subject: Re: changes to table creation syntax in 7.1.2?