Search Postgresql Archives

Re: Another INSTEAD OF TRIGGER question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 8 Mar 2020 at 15:31, stan <stanb@xxxxxxxxx> wrote:
On Sun, Mar 08, 2020 at 10:29:09AM -0400, stan wrote:
> Still working on updateable views.
>
> Wish list item, a way to see the entire query that  caused the trigger to
> fire.
>
> Now on to something i hope I can get. Can I see what the verb that caused
> the trigger to fire is? IE UPDATE, INSERT, DELETE?
>
> --
> "They that would give up essential liberty for temporary safety deserve
> neither liberty nor safety."
>                                               -- Benjamin Franklin
>
>

OH, what was I thinking, that is controled by the trigger.

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
                                                -- Benjamin Franklin

Hi, 

Still, you can access that information in the TG_OP variable available in trigger functions because you can define triggers firing on multiple operation types.
For instance this is an example from the Postgres documentation:
CREATE TRIGGER emp_audit
INSTEAD OF INSERT OR UPDATE OR DELETE ON emp_view
    FOR EACH ROW EXECUTE FUNCTION update_emp_view();
Regards,
Sándor


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux