pg_variables

an extension for defining and using variables in client sessions
Functions for defining and using variables in client sessions.

The pg_variables extension defines pgv_set and pgv_get functions for scalar variables, and several functions for record type. The variables are accessable only inside the session context. Variables are transaction indendent. Support for transactions and savepoints is planned for Postres Pro 11.

Variables can be used for storing session data, caching query results etc. In multiple cases they can be an effective replacement for temporary tables.

Availability:

 

Availability: