Re: Inheritance and Constraints

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Inheritance and Constraints
Дата
Msg-id 20030719233753.M55138-100000@megazone.bigpanda.com
обсуждение исходный текст
Ответ на Inheritance and Constraints  (Andrew Vit <avit@telus.net>)
Список pgsql-general
On Wed, 16 Jul 2003, Andrew Vit wrote:

> CREATE TABLE products (
>   id   serial      NOT NULL PRIMARY KEY,
>   name varchar(64) NOT NULL,
> );
>
> CREATE TABLE thing_1 (
>   foo  smallint,
>   bar  text,
> ) inherits (products);
>
> CREATE TABLE grading (
>   thingid  int NOT NULL REFERENCES thing_1 (id),   --this is the problem.
>   userid   int NOT NULL REFERENCES users (id),
>   vote     smallint NOT NULL,
>   PRIMARY KEY (thingid, userid)
> )

Is it complaining that there isn't a unique index on thing_1(id)?  Primary
keys don't inherit currently, so there's no constraint guaranteeing
uniqueness on thing_1.id.


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [ADMIN] Error Message Using pg_dumpall
Следующее
От: Lincoln Yeoh
Дата:
Сообщение: Re: cidr & inet types