Re: PostgreSQL: Question about rules - Mailing list pgsql-general

From Jeremy Smith
Subject Re: PostgreSQL: Question about rules
Date
Msg-id 7353a39e0611171642n4f79901aha746c50b8f0e11f7@mail.gmail.com
Whole thread Raw
In response to Re: PostgreSQL: Question about rules  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: PostgreSQL: Question about rules  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-general
On 11/17/06, Jeff Davis <pgsql@j-davis.com> wrote:
>
> Why do you need so many functions though? Won't one SQL function do the
> trick?
>
> Regards,
>         Jeff Davis
>
>

You're right, one will do the trick - I was thinking update and
delete, but of course those will be fine with plain rules because they
don't need to do anything with default values.

Even so, I guess I have to use a trigger+function instead of a real
rule, and have an INSTEAD DO NOTHING rule for insert so that the
trigger gets called without error.  Seems like a bit of a kludge; I
think I may just give up and do all this stuff in application logic
instead of database logic.

I learned a helluva lot about PG though!  Thanks!

Jeremy

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: After Update Triggers
Next
From: Tomas Vondra
Date:
Subject: Re: After Update Triggers