Re: Audit-trail engine: getting the application's layer user_id

From: Manuel Sugawara <masm(at)fciencias(dot)unam(dot)mx>
To: Tilmann Singer <tils-pgsql(at)tils(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Audit-trail engine: getting the application's layer user_id
Date: 2007-04-25 13:55:33
Message-ID: m3lkggr222.fsf@conexa.fciencias.unam.mx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Tilmann Singer <tils-pgsql(at)tils(dot)net> writes:

> So the view will reference the original table and not the temporary
> table. Is there a way to achieve this kind of transaction local
> setting? A transaction based solution would give more security in a
> situation where a web app server uses a connection pool and you can
> not guarantee 100% that your reset code is called properly at request
> init.

Nop, you do the reset part *at the end* of the request cycle:

set session id
handle request
reset session id

So, you can guarantee that the id of the session is reset and the
connection properly disposed to the pool.

Regards,
Manuel.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Marcelo de Moraes Serpa 2007-04-25 14:15:38 Re: Audit-trail engine: getting the application's layer user_id
Previous Message Manuel Sugawara 2007-04-25 13:50:08 Re: Audit-trail engine: getting the application's layer user_id