Re: PRIMARY KEY & INHERITANCE (fwd) - Mailing list pgsql-general

From Chris Bitmead
Subject Re: PRIMARY KEY & INHERITANCE (fwd)
Date
Msg-id 397526F3.A78EA510@nimrod.itg.telecom.com.au
Whole thread Raw
In response to PRIMARY KEY & INHERITANCE (fwd)  (Ferruccio Zamuner <nonsolosoft@diff.org>)
Responses Re: [HACKERS] Re: PRIMARY KEY & INHERITANCE (fwd)
List 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 by date:

Previous
From: "Brett W. McCoy"
Date:
Subject: Re: Postgres + PHP question: username in pg_connect?
Next
From: Stephan Szabo
Date:
Subject: Re: [HACKERS] Re: PRIMARY KEY & INHERITANCE (fwd)