unique/references not honored when inheriting tables

Lists: 503 토토 사이트 순위 페치 실패pgsql-hackers
From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: unique/references not honored when inheriting tables
Date: 2000-09-02 20:00:01
Message-ID: 200009022000.e82K01U25497@hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 503 토토 사이트 순위 페치 실패 pgsql-hackers

Helge Bahmann (bahmann(at)math(dot)tu-freiberg(dot)de) reports a bug with a severity of 4
The lower the number the more severe it is.

Short Description
unique/references not honored when inheriting tables

Long Description
If a table inherits fields carrying the "references" or "unique" constraint, they are not honoured but silently dropped. It is necessary to manually create the triggers/indices.

It would be nice if it were possible to create an index across a table and all sub-tables.

Sample Code
CREATE TABLE foo(id int unique)
CREATE TABLE bar() INHERITS (foo)
INSERT INTO bar VALUES(1)
INSERT INTO bar VALUES(1)

No file was uploaded with this report


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: bahmann(at)math(dot)tu-freiberg(dot)de, pgsql-bugs(at)postgresql(dot)org
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: unique/references not honored when inheriting tables
Date: 2000-10-16 16:59:21
Message-ID: 200010161659.MAA16034@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers

Is this still true in 7.1?

> Helge Bahmann (bahmann(at)math(dot)tu-freiberg(dot)de) reports a bug with a severity of 4
> The lower the number the more severe it is.
>
> Short Description
> unique/references not honored when inheriting tables
>
> Long Description
> If a table inherits fields carrying the "references" or "unique" constraint, they are not honoured but silently dropped. It is necessary to manually create the triggers/indices.
>
> It would be nice if it were possible to create an index across a table and all sub-tables.
>
>
> Sample Code
> CREATE TABLE foo(id int unique)
> CREATE TABLE bar() INHERITS (foo)
> INSERT INTO bar VALUES(1)
> INSERT INTO bar VALUES(1)
>
>
> No file was uploaded with this report
>
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026


From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: bahmann(at)math(dot)tu-freiberg(dot)de, pgsql-bugs(at)postgresql(dot)org, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: unique/references not honored when inheriting tables
Date: 2000-10-16 21:36:37
Message-ID: Pine.BSF.4.10.10010161430340.72144-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs pgsql-hackers


AFAIK, yes. Inheriting unique constraints would be a
special case of inheriting indexes theoretically, since I'd
assume that inheriting a unique column should mean unique
through entire inheritance tree. References is similar,
we'd need to do something to inherit the triggers, and
referencing to an inheritance tree needs the unique
constraint on that entire tree.

I'm not sure what it would take to do a trigger over an
inheritance tree. I guess the other option is to create
appropriate triggers when you inherit and having alter
table add/drop constraint do the same thing).

On Mon, 16 Oct 2000, Bruce Momjian wrote:

> Is this still true in 7.1?
>
>
> > Helge Bahmann (bahmann(at)math(dot)tu-freiberg(dot)de) reports a bug with a severity of 4
> > The lower the number the more severe it is.
> >
> > Short Description
> > unique/references not honored when inheriting tables
> >
> > Long Description
> > If a table inherits fields carrying the "references" or "unique" constraint, they are not honoured but silently dropped. It is necessary to manually create the triggers/indices.
> >
> > It would be nice if it were possible to create an index across a table and all sub-tables.
> >
> >
> > Sample Code
> > CREATE TABLE foo(id int unique)
> > CREATE TABLE bar() INHERITS (foo)
> > INSERT INTO bar VALUES(1)
> > INSERT INTO bar VALUES(1)
> >
> >
> > No file was uploaded with this report
> >
> >
>
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
> + If your life is a hard drive, | 830 Blythe Avenue
> + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
>