Re: inheritance of triggers (OO tables) - Mailing list pgsql-general

From Scott Goodwin
Subject Re: inheritance of triggers (OO tables)
Date
Msg-id 7A7F7298-6A62-11D8-B5C3-000A95A0910A@scottg.net
Whole thread Raw
In response to inheritance of triggers (OO tables)  ("Christoph Graf" <christoph.graf@chello.at>)
List pgsql-general
Inherited tables only inherit column characteristics, not constraints,
triggers etc. It's possible to insert values into a ChildTable that
violate unique or primary key constraints in an inherited ParentTable.
To prevent this you'd need an insert trigger on every child table that
checks to ensure values you're inserting don't violate those
constraints. Another problem is that you can't reference ParentTable
columns through the ChildTable, and they don't seem to work when you
reference them in the ParentTable either. I'd do an insert into the
ChildTable which would make the column value "show up" in the
ParentTable's primary key column, but column references didn't work
into the ParentTable for the values that were inserted this way.

Inheritance needs more development before it works in a way you'd
expect.

/s.


On Feb 28, 2004, at 7:03 PM, Christoph Graf wrote:

>
>     Hi everybody!
>
>
> As far as I have seen you can inherit from a table and get its columns.
> Is there a possibility to also inherit a tables triggers? When I simply
> derive a table from another I don't get them (-> they don't trigger).
> It
> there is a way please tell me how I do this (and where I can find more
> information about writing triggers in a OO sense - e.g. depending on
> which table actually triggers, ...), if not where can I find
> information
> about postgres object-orientation policy (if they plan to implement
> such
> things, how they handle OO)?
>
>     Yours,
>
>
>     Christoph Graf
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
> majordomo@postgresql.org
>


pgsql-general by date:

Previous
From: Ben
Date:
Subject: ispell tsearch2 dictionary
Next
From: Tom Lane
Date:
Subject: Re: Irreversible performance drop after increasing shared mem