From: | Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com> |
---|---|
To: | a <372660931(at)qq(dot)com>, pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Parameter passing in trigger function write in C |
Date: | 2018-04-27 14:40:58 |
Message-ID: | dcbe64f6-f6b4-ce51-cd49-78a85a2fe8c6@aklaver.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On 04/27/2018 07:25 AM, a wrote:
> Yep, I wanna pass the brief reason of manipulating(update, insert or
https://www.postgresql.org/docs/10/static/trigger-interface.html
"
tg_event
Describes the event for which the function is called. You can use
the following macros to examine tg_event
...
TRIGGER_FIRED_BY_UPDATE(tg_event)
Returns true if the trigger was fired by an UPDATE command.
"
> delete), name and password of the manipulator (This might be done by
> database itself).
As for user:
https://www.postgresql.org/docs/10/static/functions-info.html
"current_user name user name of current execution context"
Password?:
https://www.postgresql.org/docs/10/static/view-pg-shadow.html
Though if you are using password encryption it will be encrypted.
>
>
> ------------------ Original ------------------
> *From:* "Adrian Klaver";
> *Date:* Friday, Apr 27, 2018 10:16 PM
> *To:* "a"<372660931(at)qq(dot)com>; "pgsql-general";
> *Subject:* Re: Parameter passing in trigger function write in C
>
> On 04/26/2018 06:48 PM, a wrote:
> > hey thanks mate, I have red that. But the actual data retirement seems
> > to be combination of that and the SPI_get* functions. I'm still testing
> > on it. By the way, if I can pass parameters that is out of the scope of
> > sql statement??
>
>
> Can you be more specific about what parameters you are looking to pass in?
>
> >
> >
> > ------------------ Original ------------------
> > *From:* "Adrian Klaver";
> > *Date:* Friday, Apr 27, 2018 9:36 AM
> > *To:* "a"<372660931(at)qq(dot)com <mailto:372660931(at)qq(dot)com>>; "pgsql-general";
> > *Subject:* Re: Parameter passing in trigger function write in C
> >
> > On 04/26/2018 06:13 PM, a wrote:
> > > Hey everyone:
> > >
> > > I was request to write a trigger that perform the following function:
> > >
> > > 1, The trigger will be set to exam all statement that will result
> change
> > > of datas
> > >
> > > 2, The trigger will exam three information other than the data updated
> > > or inserted: user name, password and reasons of change
> > >
> > > 3, It will record down, in some format, the time and content of the
> > change.
> > >
> > > Therefore, I would need some way of passing parameters into the
> trigger
> > > function. Can anyone give me some instructions on how to do it or,
> if it
> > > is possible??
> >
> > https://www.postgresql.org/docs/10/static/trigger-interface.html
> <https://www.postgresql.org/docs/10/static/trigger-interface.html>
> > <https://www.postgresql.org/docs/10/static/trigger-interface.html>
> <https://www.postgresql.org/docs/10/static/trigger-interface.html>>;
> >
> >
> > --
> > Adrian Klaver
> > adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>
> <mailto:adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>>
>
>
> --
> Adrian Klaver
> adrian(dot)klaver(at)aklaver(dot)com <mailto:adrian(dot)klaver(at)aklaver(dot)com>
--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com
From | Date | Subject | |
---|---|---|---|
Next Message | Steven Lembark | 2018-04-27 14:55:37 | Re: Rationale for aversion to the central database? |
Previous Message | Steven Lembark | 2018-04-27 14:30:27 | Re: Long running INSERT+SELECT query |