sharing variables between client and server again

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: sharing variables between client and server again
Date: 2012-08-13 16:13:17
Message-ID: CAFj8pRAg3WOEzzVui1_1mJuaBOF+saQ9wajK4gMNhKZBO2=i0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello

this is VIP patch that implements shared - "status" variables to
PostgreSQL. A motivation for this features is possibility to take
client parameters inside inlined PL blocks.

This design is based on Magnus's ideas. Content is synchronized
between server and client. This doesn't need a protocol enhancing.

pavel ~ $ psql postgres -v status.myparam=Hello
psql (9.3devel)
Type "help" for help.

postgres=# \echo :status.myparam
Hello
postgres=# show status.myparam;
status.myparam
----------------
Hello
(1 row)

postgres=# do $$ begin raise notice '%',
current_setting('status.myparam'); end $$ language plpgsql;
NOTICE: Hello
DO

postgres=# set status.myparam = 'Bobo';
SET
postgres=# \echo :status.myparam
Bobo

postgres=# \set status.myparam Otis
postgres=# show status.myparam;
status.myparam
----------------
Otis
(1 row)

Regards

Pavel Stehule

Attachment Content-Type Size
shared_variables.diff application/octet-stream 12.5 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-08-13 17:04:58 SIGFPE handler is naive
Previous Message Heikki Linnakangas 2012-08-13 13:45:13 Re: Bug in libpq implentation and omission in documentation?