Re: Dynamic datalogging function/scheme

From: Mike Rylander <mrylander(at)gmail(dot)com>
To: rob <robklaus(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Dynamic datalogging function/scheme
Date: 2006-02-15 20:45:31
Message-ID: b918cf3d0602151245j27a55b3r4ec66abdd4b6221b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I developed, and have been using, this[1] and it's been working fine for me. :)

http://open-ils.org/blog/?p=28

On 15 Feb 2006 10:10:29 -0800, rob <robklaus(at)gmail(dot)com> wrote:
> Hello,
>
>
>
> Looking for advice on creating as dynamic a datalogging scheme as I can
> using plpgsql.
>
>
> The idea would be to have a trigger function that I could drop on any
> table in my database. Then on update, the function would iterate
> through each field, and check to see if NEW.<fieldname> <>
> OLD.<fieldname>. Then a function would be called that would insert
> data into a logging table.
>
> I can do this in a very static sense whereby each table has its own
> specific trigger function that specifies each column by name
> (NEW.co_name <> OLD.co_name), etc. But, this is pretty cumbersome, and
> as new columns are added, we would need to remember to go in and change
> the function.
>
> Running Postgresql 8.1
>
> Thanks for any advice/help!
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

--
Mike Rylander
mrylander(at)gmail(dot)com
GPLS -- PINES Development
Database Developer
http://open-ils.org

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Randal L. Schwartz 2006-02-15 20:50:00 Re: Oracle purchases Sleepycat - is this the "other shoe" for MySQL AB?
Previous Message Scott Marlowe 2006-02-15 20:45:07 Re: I see this as the end of BDB in MySQL without a