How to set some context variable for a user/connection
You can use a session variables in custom schema:
postgres=# set myvars.language_id = 10;
SET
postgres=# show myvars.language_id;
myvars.language_id
--------------------
10
(1 row)
or via functions (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)