Обсуждение: user defined variables
hi, isn't it possible to define own environment vars? thanks, moritz -- /* * Oops. The kernel tried to access some bad page. We'll have to * terminate things with extreme prejudice. */ die_if_kernel("Oops", regs, error_code); -- From linux/arch/i386/mm/fault.c
On 24 May 2002, Moritz Sinn wrote: > > hi, > > isn't it possible to define own environment vars? > Did I miss something? I'd answer with: Errrrr.......yeeeeees. Except I've got this distinct feeling I must have missed something. What is it you're trying to achieve other than setting environment variables which is shell specific? -- Nigel J. Andrews Director --- Logictree Systems Limited Computer Consultants
"Nigel J. Andrews" <nandrews@investsystems.co.uk> writes: > On 24 May 2002, Moritz Sinn wrote: > > > > hi, > > > > isn't it possible to define own environment vars? > > > > Did I miss something? > > I'd answer with: > > Errrrr.......yeeeeees. > > Except I've got this distinct feeling I must have missed something. > > What is it you're trying to achieve other than setting environment variables > which is shell specific? well, i mean i want to make a value available under a certain name, for the whole db session. i want to do something like "UID=4545323667424;" and then be able to say "SELECT * FROM USER WHERE uid=UID;" But SET only accepts predefined environment variables. thanks, moritz -- #define FALSE 0 /* This is the naked Truth */ #define TRUE 1 /* and this is the Light */ -- mailto.c
> -----Original Message----- > From: pgsql-general-owner@postgresql.org > [mailto:pgsql-general-owner@postgresql.org]On Behalf Of Moritz Sinn > Sent: Friday, May 24, 2002 11:21 AM > To: Nigel J. Andrews > Cc: pgsql-general@postgresql.org > Subject: Re: [GENERAL] user defined variables > > > "Nigel J. Andrews" <nandrews@investsystems.co.uk> writes: > > > On 24 May 2002, Moritz Sinn wrote: > > > > > > hi, > > > > > > isn't it possible to define own environment vars? > > > > > > > Did I miss something? > > > > I'd answer with: > > > > Errrrr.......yeeeeees. > > > > Except I've got this distinct feeling I must have missed something. > > > > What is it you're trying to achieve other than setting > environment variables > > which is shell specific? > > well, i mean i want to make a value available under a certain name, for > the whole db session. > i want to do something like "UID=4545323667424;" and then be able to say > "SELECT * FROM USER WHERE uid=UID;" > > But SET only accepts predefined environment variables. In the psql client, you can set a variable with the "\set" command, or using "--set" at startup. So "psql --set UID=xxxx" will let you use the the UID as "SELECT * FROM USER WHERE uid= :UID". Will this work for you? - J. Joel BURTON | joel@joelburton.com | joelburton.com | aim: wjoelburton Knowledge Management & Technology Consultant
"Joel Burton" <joel@joelburton.com> writes: > In the psql client, you can set a variable with the "\set" command, or using > "--set" at startup. So "psql --set UID=xxxx" will let you use the the UID as > "SELECT * FROM USER WHERE uid= :UID". > > Will this work for you? > > - J. well, i'm using the php functions for communicating with postgresql. but this means that it is possible. has someone an idea how i can set such a variable when i open the connection with php? thanks, moritz -- <grin> seen jhm <dpkg> jhm is Sarek, and jhm is on the channel right now! * JHM wonders why dpkg remembers that particular nick. <grin> dpkg: Sarek? ermm, sure, and I am Khan -- Seen on #Debian