Global variables in plpgsql

Started by Nick Rajalmost 15 years ago3 messages
#1Nick Raj
nickrajjain@gmail.com

Hi,
Can anyone know how to define global variable in plpgsql?
Thanks

Regards,
Raj

#2Christopher Browne
cbbrowne@gmail.com
In reply to: Nick Raj (#1)
Re: Global variables in plpgsql

On Mon, Apr 11, 2011 at 7:33 AM, Nick Raj <nickrajjain@gmail.com> wrote:

Can anyone know how to define global variable in plpgsql?

I expect you should consult the manual page on the command CREATE
TABLE. That's what would be the nearest SQL equivalent to a "global
variable."

http://www.postgresql.org/docs/9.0/static/sql-createtable.html
--
http://linuxfinances.info/info/postgresql.html

#3Pavel Stehule
pavel.stehule@gmail.com
In reply to: Nick Raj (#1)
Re: Global variables in plpgsql

Hello

2011/4/11 Nick Raj <nickrajjain@gmail.com>:

Hi,
Can anyone know how to define global variable in plpgsql?
Thanks

Regards,
Raj

plpgsql doesn't support global or session variables.

There are a few techniques - you can emulate it

http://www.postgresql.org/docs/8.3/static/plperl-global.html

Regards

Pavel Stehule