Re: inheritance of triggers (OO tables)

From: Scott Goodwin <scott(at)scottg(dot)net>
To: "Christoph Graf" <christoph(dot)graf(at)chello(dot)at>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: inheritance of triggers (OO tables)
Date: 2004-02-29 02:53:40
Message-ID: 7A7F7298-6A62-11D8-B5C3-000A95A0910A@scottg.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-02-29 03:30:12 Re: Irreversible performance drop after increasing shared mem
Previous Message Ben 2004-02-29 02:42:19 ispell tsearch2 dictionary