Helge Bahmann (bahmann@math.tu-freiberg.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


Sat, 2 Sep 2000 16:00:01 -0400 (EDT)
pgsql-bugs@postgresql.org
unique/references not honored when inheriting tables
Is this still true in 7.1?


> Helge Bahmann (bahmann@math.tu-freiberg.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@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Mon, 16 Oct 2000 12:59:21 -0400 (EDT)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: unique/references not honored when inheriting tables

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@math.tu-freiberg.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@candle.pha.pa.us               |  (610) 853-3000
>   +  If your life is a hard drive,     |  830 Blythe Avenue
>   +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026
> 



Mon, 16 Oct 2000 14:36:37 -0700 (PDT)
Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: unique/references not honored when inheriting tables