Re: history table

From: Guy Rouillier <guyr-ml1(at)burntmail(dot)com>
To: PostgreSQL general <pgsql-general(at)postgresql(dot)org>
Subject: Re: history table
Date: 2007-08-21 19:06:48
Message-ID: 46CB37C8.9050309@burntmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Robin Helgelin wrote:
> Hi,
>
> I want to save history for a few tables using triggers on update and
> creation. What's the best approach to do this in a webapp environment
> where I want to save which webapp user that is doing the change, not
> the postgresql user?
>

Well, you haven't told us much about your webapp. Are you using
connection pooling? If so, then you'll need to provide the webapp
userid as an additional parameter to your database updates. If you are
not using connection pooling, such that your webapp userids are
connecting as themselves, then the problem becomes much easier; you've
got the correct userid to log by just looking at the connection details.

--
Guy Rouillier

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2007-08-21 19:19:03 Re: Array with Subselect / ANY - cast?
Previous Message A. Kretschmer 2007-08-21 18:49:37 Re: history table