Re: How to determine field names in a trigger? - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: How to determine field names in a trigger?
Date
Msg-id 20040629050947.GA19329@dcc.uchile.cl
Whole thread Raw
In response to How to determine field names in a trigger?  (Justin Clift <jc@telstra.net>)
Responses Re: How to determine field names in a trigger?
List pgsql-general
On Tue, Jun 29, 2004 at 01:59:11PM +1000, Justin Clift wrote:

Justin,

> I'm creating a centralised table to keep a log of changes in other tables.
>
> In thinking about the PL/pgSQL trigger to write and attach to the
> monitored tables (probably a row level AFTER trigger), I can see two
> approaches:

I think you can do this very easily with PL/Tcl.  For a somewhat
unrelated example, see General Bits issue #47,

http://www.varlena.com/GeneralBits/47.php

_I think_ there are examples closer to what you want to achieve in the
archives.  The array of column names in a trigger is $TG_relatts.

Hope this helps,

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"La libertad es como el dinero; el que no la sabe emplear la pierde" (Alvarez)


pgsql-general by date:

Previous
From: Együd Csaba
Date:
Subject: Re: Performance problem on RH7.1
Next
From: dalgoda@ix.netcom.com (Mike Castle)
Date:
Subject: Re: Multiple databases on seperate drives/file systems?