Re: can I define own variables?

From: "Trevor Talbot" <quension(at)gmail(dot)com>
To: "Guy Rouillier" <guyr-ml1(at)burntmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: can I define own variables?
Date: 2007-10-13 08:21:42
Message-ID: 90bce5730710130121m4bf4c8a1hfe4a17ede4f99cf1@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10/12/07, Guy Rouillier <guyr-ml1(at)burntmail(dot)com> wrote:

> I've had several occasions when a user-defined variable would have come
> in handy. What is the scope of user_vars as you've defined them above?
> Are they unique to a connection? A user_id? Or defined globally?
> Ideally, they would be connection-unique. One place they would come in
> really handy is with web-apps using connection pooling. I could stuff
> the userid of the person who connected to my secure website into a
> user_var, then the database could access that to track user actions.
> Right now, that is cumbersome to do, since the current_user is always
> the same: the userid for the connection pool.

The Veil project might be worth looking at: http://veil.projects.postgresql.org/

It's designed with providing row-level security through views in mind,
but it does that with global and session variable primitives.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Peterson 2007-10-13 12:50:56 Re: convert binary string to datum
Previous Message Gregory Stark 2007-10-13 05:22:06 Re: convert binary string to datum