Re: A question relative to creating an audit table

2020-02-28 Thread Andrei Zhidenkov
Please, read chapter 43.10.1 of the PostgreSQL documentation (https://www.postgresql.org/docs/11/plpgsql-trigger.html ). Just to be sure we are on the same page. > On 28. Feb 2020, at 14:59, stan wrote: > > On Thu, Feb 27, 2020 at 10:30

Re: A question relative to creating an audit table

2020-02-28 Thread stan
On Thu, Feb 27, 2020 at 10:30:15PM +0100, Andrei Zhidenkov wrote: > Why not to pass TG_TABLE_SCHEMA and TG_TABLE_NAME in its arguments? > > > On 27. Feb 2020, at 22:28, stan wrote: > > > > I ma considering setting up a function, and triggers to put a record in an > > audit table when certain tab

Re: A question relative to creating an audit table

2020-02-27 Thread Vik Fearing
On 27/02/2020 22:28, stan wrote: > I ma considering setting up a function, and triggers to put a record in an > audit table when certain tables are altered. I pretty much think I know how > to do this, with one exception. There are extensions out there that deal with this for you. Here is one: ht

Re: A question relative to creating an audit table

2020-02-27 Thread Adrian Klaver
On 2/27/20 1:28 PM, stan wrote: I ma considering setting up a function, and triggers to put a record in an audit table when certain tables are altered. I pretty much think I know how to do this, with one exception. Can a function, called by a trigger, determine what table it was called for? A

Re: A question relative to creating an audit table

2020-02-27 Thread Andrei Zhidenkov
Why not to pass TG_TABLE_SCHEMA and TG_TABLE_NAME in its arguments? > On 27. Feb 2020, at 22:28, stan wrote: > > I ma considering setting up a function, and triggers to put a record in an > audit table when certain tables are altered. I pretty much think I know how > to do this, with one excepti

A question relative to creating an audit table

2020-02-27 Thread stan
I ma considering setting up a function, and triggers to put a record in an audit table when certain tables are altered. I pretty much think I know how to do this, with one exception. Can a function, called by a trigger, determine what table it was called for? -- "They that would give up essentia