Restrictions on columns are not being passed to children tables. - Mailing list pgsql-bugs

From Holger Klawitter
Subject Restrictions on columns are not being passed to children tables.
Date
Msg-id 39F5B26E.30A205AB@klawitter.de
Whole thread Raw
List pgsql-bugs
Hi there,

I am not sure whether this is a design flaw in the inheritance scheme
of Postgres or a generic problem with DB design (or a problem with
my understanding of inheritance in RDBS :-)

Imagine the following situation:

    CREATE TABLE parent ( id INT UNIQUE );
    CREATE TABLE child () INHERITS ( parent );
    INSERT INTO parent VALUES ( 1 );
    INSERT INTO parent VALUES ( 1 );  -- breaks as expected --
    INSERT INTO child VALUES( 1 );    -- works, but shouldn't --
    INSERT INTO child VALUES( 1 );    -- works even the second time --

    SELECT * from parent*;            -- not much of a unique, is it? --

Everything is still fine while SELECTing on "parent" instaed of
"parent*". A word of a warning might be useful in the docs :-)

Regards,
Mit freundlichem Gruß,
    Holger Klawitter
--
Holger Klawitter                                    +49 (0)251 484 0637
holger@klawitter.de                            http://www.klawitter.de/

pgsql-bugs by date:

Previous
From: pgsql-bugs@postgresql.org
Date:
Subject: Updating multiple bool values crashes backend
Next
From: Holger Klawitter
Date:
Subject: Restrictions on columns are not being passed to children tables.