Anda dapat menggunakan variabel sesi dalam skema khusus:
postgres=# set myvars.language_id = 10;
SET
postgres=# show myvars.language_id;
myvars.language_id
--------------------
10
(1 row)
atau melalui fungsi (http://www.postgresql.org/docs /9.4/static/functions-admin.html ):
postgres=# select set_config('myvars.language_id', '20', false);
set_config
------------
20
(1 row)
postgres=# select current_setting('myvars.language_id');
current_setting
-----------------
20
(1 row)