Re: Function To Log Changes - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Function To Log Changes
Date
Msg-id 200404051018.26429.josh@agliodbs.com
Whole thread Raw
In response to Function To Log Changes  ("Gavin" <gavin@grabias.com>)
List pgsql-sql
Gavin,

> Hi All, I have been tinkering with a function to log the changes made on
> any column through a function and trigger.  However, I cant think of a way
> to make this work through pl/pgsql.  Any one have any ideas, or is it just
> not possible?

It could be done, but would be extremely slow and awkward using current PL/
pgsql syntax.    You'd have to query the system tables for a list of columns, 
and then execute a series of dynamic queries.

I recommend instead one of the following two approaches:

1) Simply log the whole row of each archived table and don't worry about 
logging the individual columns, or

2) Use PL/tcl, PL/Pyton, or C where you can select columnns by ordinal 
position or other dynamic factor.

-- 
-Josh BerkusAglio Database SolutionsSan Francisco



pgsql-sql by date:

Previous
From: abhi
Date:
Subject: Getting the ranks of results from a query
Next
From: Gregor Rot
Date:
Subject: Re: order of results