Skip site navigation (1) Skip section navigation (2)

Re: PostgreSQL User-Defined Global Variables

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: "Van Ingen, Lane" <lvaningen(at)ESNCC(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: PostgreSQL User-Defined Global Variables
Date: 2005-07-07 04:33:35
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
On Wed, Jul 06, 2005 at 03:16:56PM -0400, Van Ingen, Lane wrote:
> Is it possible, via standard PostgreSQL or an extension, to set
> up a user-defined global variable outside of a stored procedure,
> and be able to query against the value of that variable?

Some people use temporary tables for storing such values.  Another
way would be to write set/get functions in a language that supports
global storage (PL/Perl, PL/Tcl, PL/Python, etc.).  See for example
the set_var() and get_var() functions in the PL/Perl documentation:

Michael Fuhr

In response to

pgsql-novice by date

Next:From: Andreas KretschmerDate: 2005-07-07 05:06:50
Subject: Re: [despammed] PostgreSQL User-Defined Global Variables
Previous:From: Bruno Wolff IIIDate: 2005-07-07 04:03:21
Subject: Re: User Defined Note Order Problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group