sharing variables between client and server again - Mailing list pgsql-hackers

From Pavel Stehule
Subject sharing variables between client and server again
Date
Msg-id CAFj8pRAg3WOEzzVui1_1mJuaBOF+saQ9wajK4gMNhKZBO2=i0w@mail.gmail.com
Whole thread Raw
List 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

pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: Bug in libpq implentation and omission in documentation?
Next
From: Robert Haas
Date:
Subject: SIGFPE handler is naive