Re: changes to table creation syntax in 7.1.2?

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Jayson Callaway <jayson(dot)callaway(at)iona(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: changes to table creation syntax in 7.1.2?
Date: 2001-08-29 18:24:56
Message-ID: Pine.BSF.4.21.0108291122540.48187-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Jason Earl 2001-08-29 20:34:47 Re: changes to table creation syntax in 7.1.2?
Previous Message Josh Berkus 2001-08-29 14:38:00 Re: getting the oid for a new tuple in a BEFORE trigger