Search code examples
sqlpostgresqlplpgsqlinformix

Equivalent of Informix GLOBAL modifier in PostgreSQL


I need to find equivalent of Informix GLOBAL modifier in Postgresql. From Informix guide: The GLOBAL keyword indicates that the variables that follow have a scope of reference that includes all SPL routines that run in a given DB-Access or SQL administration API session.


Solution

  • Postgres set session "configuration parameters" have session scope:

    SET only affects the value used by the current session.

    Example usage:

    set session "myvars.var1" = '3.1415';
    ...
    select current_setting('myvars.var1');