Re: [GENERAL] Inheritance and primary key

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Guillaume Rousse <Guillaume(dot)Rousse(at)univ-reunion(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Inheritance and primary key
Date: 2000-01-12 01:47:39
Message-ID: Pine.LNX.4.21.0001120237460.3735-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

This is a known bug (TODO item "Unique index on base column not honored on
inserts from inherited table"). Not sure though when or how this will be
fixed.

On 2000-01-10, Guillaume Rousse mentioned:

>
> I use a super-class S (virtual, in fact) ans three inheritated classes S1, S2
> and S3. i wish to have a primary key for all these classes, in order to use
> queries as : SELECT * FROM S* WHERE s.id=x
> I use a serial ID field for S as a primary key. Sequencing is OK, as any
> insertion in any of the four classes increments the counter. But uniqueness
> constraint is lost, as i can have duplicated values between differents classes.
> And even in the same class for the inherited ones, as primary key propertie of
> ID column is lost through inheritance. And i can't specify a unique constraint
> on this column, as it is not present in the class definition.
> How to solve this problem ?
>
> --
> Guillaume Rousse
> *******************************************
> Iremia -Université de la Réunion
> 15 avenue René Cassin, BP 7151
> 97715 Saint Denis, messagerie cedex 9
> Tel:0262938287 Fax:0262938260 ICQ:10756815
> Mail:Guillaume(dot)Rousse(at)univ-reunion(dot)fr
>
> BRIDGEKEEPER: What... is the air-speed velocity of an unladen swallow?
> ARTHUR: What do you mean? An African or European swallow?
>
>
> ************
>
>

--
Peter Eisentraut Sernanders väg 10:115
peter_e(at)gmx(dot)net 75262 Uppsala
http://yi.org/peter-e/ Sweden

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Palle Girgensohn 2000-01-12 03:35:15 blocksize problem
Previous Message Peter Eisentraut 2000-01-12 01:47:25 Re: [GENERAL] Where is my database gone ?