Search Postgresql Archives

Re: Is it possible to get username information while writingtrigger?

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

 



a wrote:
> Please allow me to ask few more questions:
> 
> 1, Since I'm writing a C trigger function, is there any method for me to get some of the
>    basic information like the follow:
> 
>      (1) Total number of rows;
>      (2) Rows' names;
>      (3) Value of OLD and NEW;
> 
> 2, Is there any possibility of passing the SQL statement it self into the trigger?
> 
> 3, Is it possible for me to exam before statement trigger so that I would be able to loop it
>    once and copying the update information to the rest of rows.

I don't know if there is a reliable way to get the SQL statement from
a C trigger.

For the other things, perhaps a statement level trigger with transition
relations can help.

You can then access the transition relations from your C code with
the tg_oldtable and tg_newtable tuplestores.
(https://www.postgresql.org/docs/current/static/trigger-interface.html)

Yours,
Laurenz Albe
-- 
+43-670-6056265
Cybertec Schönig & Schönig GmbH
Gröhrmühlgasse 26, A-2700 Wiener Neustadt
Web: https://www.cybertec-postgresql.com




[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