Re: PRIMARY KEY & INHERITANCE (fwd)

From: Chris Bitmead <chrisb(at)nimrod(dot)itg(dot)telstra(dot)com(dot)au>
To: nonsolosoft(at)diff(dot)org
Cc: pgsql-general(at)hub(dot)org, "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: PRIMARY KEY & INHERITANCE (fwd)
Date: 2000-07-19 03:56:35
Message-ID: 397526F3.A78EA510@nimrod.itg.telecom.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

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?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2000-07-19 05:25:26 Re: [HACKERS] Re: PRIMARY KEY & INHERITANCE (fwd)
Previous Message Brett W. McCoy 2000-07-19 00:09:28 Re: Postgres + PHP question: username in pg_connect?

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-07-19 04:51:24 Re: MySQL comparison
Previous Message Hiroshi Inoue 2000-07-19 03:54:56 RE: btree split logic is fragile in the presence of large index items