Re: Rules versus triggers - Mailing list pgsql-general

From Justin
Subject Re: Rules versus triggers
Date
Msg-id CALL-XePeFfzP6HMJUSmrcHW5gm+OBAnZGuhCAK+=WL+a_xb4OQ@mail.gmail.com
Whole thread Raw
In response to Re: Rules versus triggers  (stan <stanb@panix.com>)
Responses Re: Rules versus triggers  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
List pgsql-general
Yes a rule can rewrite query or replace the query

Read through Depesz  post about rules and the weird side affects that can occurr



On Sat, Mar 7, 2020 at 9:57 AM stan <stanb@panix.com> wrote:
On Sat, Mar 07, 2020 at 09:47:39AM -0500, Justin wrote:
> Hi Stan
>
> Rules actual are able to rewrite the SQL query sent to  postgresql.  Most
> everyone suggestion is avoid rules.
>
> Triggers are just like every other databases Triggers firing off code for
> Insert/Update/Delete/Truncate event
> https://www.postgresql.org/docs/current/sql-createtrigger.html
>

So, the RULE can actually rewrite the query, instead of replacing it,
which is what I m doing in the function, correct?
--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
                                                -- Benjamin Franklin

pgsql-general by date:

Previous
From: stan
Date:
Subject: Re: Rules versus triggers
Next
From: Ashkar Dev
Date:
Subject: duplicate key value violates unique constraint