Re: PRIMARY KEY & INHERITANCE (fwd)

Поиск
Список
Период
Сортировка
От Chris Bitmead
Тема Re: PRIMARY KEY & INHERITANCE (fwd)
Дата
Msg-id 397526F3.A78EA510@nimrod.itg.telecom.com.au
обсуждение исходный текст
Ответ на PRIMARY KEY & INHERITANCE (fwd)  (Ferruccio Zamuner <nonsolosoft@diff.org>)
Ответы Re: [HACKERS] Re: PRIMARY KEY & INHERITANCE (fwd)  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-general
Something on the TODO list is that indexes should be inherited by
default. Unfortunately, right now they are not. I'm not sure what the
interaction is here with the foreign key mechanism, so I'm CCing this to
hackers to see if anyone there might comment.

Ferruccio Zamuner wrote:
>
> Hi,
>
> please look at following example:
>
> CREATE TABLE picture (
> id serial not null,
> description text,
> filename text);
>
> CREATE TABLE advert (
> artist text,
> customer text,
> target text)
> INHERITS (picture);
>
> CREATE TABLE work (
> id serial not null,
> advert_id int4 not null references advert,
> value numeric(6,2) default 0);
>
> NOTICE:  CREATE TABLE will create implicit sequence 'work_id_seq' for SERIAL
> col
> umn 'work.id'
> NOTICE:  CREATE TABLE/UNIQUE will create implicit index 'work_id_key' for
> table
> 'work'
> NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
> ERROR:  PRIMARY KEY for referenced table "advert" not found
>
> How can I create PRIMARY KEY CONSTRAINT for table advert?

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

Предыдущее
От: "Brett W. McCoy"
Дата:
Сообщение: Re: Postgres + PHP question: username in pg_connect?
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: [HACKERS] Re: PRIMARY KEY & INHERITANCE (fwd)