                      Session-Variables in PostgreSQL

There is a possiblity to use session local in PostgreSQL. The trick is to
identify the current session by its process id, and to store name value pairs
together with this id in some table. The sessvars.sql script creates the 
following functions (along with a table to store the variable values).

set_session_var(varname varchar, newvalue varchar)
  Sets a session local variable.

get_session_var(varname varchar)
  Retrieves the value of a session local variable. Returns null, if the
 	variable does not exist.

remove_session_var(varname varchar)
  Removes a session local variable.

clear_session_vars()
  Clears all variables of this session.

cleanup_session_vars()
  Removes all variables left from previous sessions. No variables of any current
	session are touched here. 

The current problem here is that session variables are not really local, but
stay in the table until deleted. Thus you should call cleanup_session_vars()
from time to time. This could be fixed in a later version by on-the-fly creation
of a temporary table. 
