Re: changes to table creation syntax in 7.1.2?

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: changes to table creation syntax in 7.1.2?
Дата
Msg-id Pine.BSF.4.21.0108291122540.48187-100000@megazone23.bigpanda.com
обсуждение исходный текст
Ответ на changes to table creation syntax in 7.1.2?  ("Jayson Callaway" <jayson.callaway@iona.com>)
Список 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 по дате отправления:

Предыдущее
От: "Jayson Callaway"
Дата:
Сообщение: changes to table creation syntax in 7.1.2?
Следующее
От: Jason Earl
Дата:
Сообщение: Re: changes to table creation syntax in 7.1.2?