Re: Why can't I put a BEFORE EACH ROW trigger on a view? - Mailing list pgsql-general

From Joshua D. Drake
Subject Re: Why can't I put a BEFORE EACH ROW trigger on a view?
Date
Msg-id 45E0D792.1090504@commandprompt.com
Whole thread Raw
In response to Why can't I put a BEFORE EACH ROW trigger on a view?  ("Karl O. Pinc" <kop@meme.com>)
Responses Re: Why can't I put a BEFORE EACH ROW trigger on a view?  ("Karl O. Pinc" <kop@meme.com>)
Re: Why can't I put a BEFORE EACH ROW trigger on a view?  ("Karl O. Pinc" <kop@meme.com>)
List pgsql-general
Karl O. Pinc wrote:
> Hi,
>
> I want to do some additional data validation
> when data is changed through a view, and
> I want pretty exception messages, and I want to
> do some slightly complex processing when
> determining what data to update where in
> what order.
>
> So, I figured I'd make a table, put some
> BEFORE EACH ROW triggers on it to do
> all the tricky stuff, sometimes including
> changing other tables, and then put a
> SELECT rule on the table to make it look
> like a view.
>
> Turns out there's undocumented restrictions,
> and this turns the table into a view which
> then can't have triggers on it.

huh?

create your table, create your triggers on the table.
Use a view on top of the table for viewing (there is no such thing as a
select rule (well there is, but it is called a view)).

Sincerely,

Joshua D. Drake

Sincerely,

Joshua D. Drake


--

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


pgsql-general by date:

Previous
From: "Karl O. Pinc"
Date:
Subject: Why can't I put a BEFORE EACH ROW trigger on a view?
Next
From: "Karl O. Pinc"
Date:
Subject: Re: Why can't I put a BEFORE EACH ROW trigger on a view?