user variables in session

From: Igor Shevchenko <igor(at)carcass(dot)ath(dot)cx>
To: pgsql-general(at)postgresql(dot)org
Subject: user variables in session
Date: 2010-03-22 15:55:00
Message-ID: 201003221755.00952.igor@carcass.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,

I wasn't able to find any functions which would allow me to save/fetch/remove
user variables local to pgsql session, e.g. -

1. select setvar('user variable name', 'user value');
2. select getvar('user variable name');
3. select delvar('user variable name');

Is there any way to do this with stock PostgreSQL, or via something in
contrib?

Would pgsql's HTAB with hash_create and hash_search be a good basis for a
simple C extension which would provide such feature ?

I found this to be quite useful in e.g. pl/pgsql triggers, for logging.

--
Best Regards,
Igor Shevchenko

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Greg Smith 2010-03-22 16:06:34 Re: Reducing excess files in pg_xlog
Previous Message Dimitri Fontaine 2010-03-22 15:40:30 Re: stopping processes, preventing connections