Re: user defined variable per session

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: Claudio Lapidus <clapidus(at)hotmail(dot)com>
Cc: "hlavki(at)medium13" <hlavki(at)medium13(dot)sk>, PostgreSQL general list <pgsql-general(at)postgresql(dot)org>
Subject: Re: user defined variable per session
Date: 2003-12-07 20:14:57
Message-ID: 1070828097.4739.19.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 2003-12-07 at 19:57, Claudio Lapidus wrote:
> > I need to create user defined variable in every database session.
> > In Sybase ASA is equivalent:
> > CREATE VARIABLE name TYPE;
> >
> > I need use this in views. Is it possible???
>
> What about
>
> test=> \set myvar 5
> test=> select :myvar;
> ?column?
> ----------
> 5
> (1 row)

But that is specific to psql. It's not something you can use in an
application, as you might the Sybase command.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"And if thy hand offend thee, cut it off; it is better
for thee to enter into life maimed, than having two
hands to go into hell, into the fire that never shall
be quenched." Mark 9:43

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2003-12-07 20:15:53 Re: GRANT ON C
Previous Message Martin Marques 2003-12-07 20:13:32 Re: GRANT ON C