Thread

  1. unique/references not honored when inheriting tables

    PostgreSQL Bugs List <pgsql-bugs@postgresql.org> — 2000-09-02T20:00:01Z

    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
    
    
    
  2. Re: unique/references not honored when inheriting tables

    Bruce Momjian <pgman@candle.pha.pa.us> — 2000-10-16T16:59:21Z

    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
    
    
  3. Re: unique/references not honored when inheriting tables

    Stephan Szabo <sszabo@megazone23.bigpanda.com> — 2000-10-16T21:36:37Z

    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
    >