session_variable
Registration and manipulation of session variables and constants
session_variable : Registration and manipulation of session variables and constants
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 9120 | session_variable | session_variable | 3.4 |
SIM | GPL-3.0 | C |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | session_variable |
| See Also | orafce db2fce pgtt ivorysql_ora pg_statement_rollback pg_variables omni_var |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 3.4 |
18 17 16 15 14 | session_variable |
- |
| RPM | PIGSTY | 3.4 |
18 17 16 15 14 | session_variable_$v |
- |
| DEB | PIGSTY | 3.4 |
18 17 16 15 14 | postgresql-$v-session-variable |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| el8.aarch64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| el9.x86_64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| el9.aarch64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| el10.x86_64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| el10.aarch64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| d12.x86_64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| d12.aarch64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| d13.x86_64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| d13.aarch64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| u22.x86_64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| u22.aarch64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| u24.x86_64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| u24.aarch64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| u26.x86_64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
| u26.aarch64 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 | PIGSTY 3.4 |
Source
github.com/splendiddata/session_variable
session_variable-3.4.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
session_variable: Registration and manipulation of session variables and constants
Creating Variables and Constants
Getting and Setting Values
Using in PL/pgSQL
Administration Functions
Key Behaviors
- Variables are defined at the database level; each session gets a local copy
set()only changes the session-local copy; other sessions are unaffectedalter_value()changes the stored value; new sessions see it, existing sessions needinit()to refresh- Constants cannot be changed via
set(), only viaalter_value() - Variable and constant names must be unique across both types