pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: stan <stanb@panix.com>
To: Andrei Zhidenkov <andrei.zhidenkov@n26.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: A question relative to creating an audit table
Date: Fri, 28 Feb 2020 08:59:47 -0500
Message-ID: <20200228135947.GA16442@panix.com> (raw)
In-Reply-To: <7BF2891E-FA4E-49CC-8477-A0537572CD84@n26.com>
References: <20200227212847.GB3663@panix.com>
	<7BF2891E-FA4E-49CC-8477-A0537572CD84@n26.com>

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 <stanb@panix.com> 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?
> > 

I suppose I could do that. I have in mind a single function to accomplish the
audit log, but I will have to have unique triggers for each table. I was
just hoping not to have to do that. Are these values that I could read
automatically? Or do I have to hard code them?

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





view thread (6+ messages)  latest in thread

Message-ID: <20200228135947.GA16442@panix.com>
Permalink:  ../20200228135947.GA16442@panix.com/
Also on:    postgresql.org/message-id/20200228135947.GA16442@panix.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: stanb@panix.com, andrei.zhidenkov@n26.com
  Subject: Re: A question relative to creating an audit table
  In-Reply-To: <20200228135947.GA16442@panix.com>
  References: <20200227212847.GB3663@panix.com> <7BF2891E-FA4E-49CC-8477-A0537572CD84@n26.com> <20200228135947.GA16442@panix.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox