psql - user defined SQL variables - Mailing list pgsql-general

From Grainne Reilly
Subject psql - user defined SQL variables
Date
Msg-id 6.0.3.0.0.20040817233150.00b233a8@mail.comcast.net
Whole thread Raw
Responses Re: psql - user defined SQL variables  (Tino Wildenhain <tino@wildenhain.de>)
Re: psql - user defined SQL variables  (David Fetter <david@fetter.org>)
List pgsql-general
I am new to PostgreSQL and am porting some scripts written for MySQL over
to psql.  There is one MySQL feature which I cannot find in psql - user
defined SQL variables. In MySQL I can use these to hold the result
(numeric, string or null) of a select: e.g.
select @count = count(*) from mytable;
The @count variable now holds the result of that select, and I can use it
in where clauses, updates, inserts  etc.
I checked out the \set psql variable but I haven't found a way to tweak it
to give me the result of a sql statement - is there any way to do that (I'm
using PostgreSQL version 7.4.3)?
Thanks in advance for any suggestions,
Grainne.



pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Any recommended forums/wiki/blog s/w that uses
Next
From: Tino Wildenhain
Date:
Subject: Re: psql - user defined SQL variables