Re: proposal - assign result of query to psql variable - Mailing list pgsql-hackers

From Tom Lane
Subject Re: proposal - assign result of query to psql variable
Date
Msg-id 25376.1343368168@sss.pgh.pa.us
Whole thread Raw
In response to Re: proposal - assign result of query to psql variable  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: proposal - assign result of query to psql variable  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2012/7/26 David Fetter <david@fetter.org>:
>>>> How about
>>>> \gset var1,,,var2,var3...

>>> I don't like this - you can use fake variable - and ignoring some
>>> variable has no big effect on client

>> Why assign to a variable you'll never use?

> so why you get data from server, when you would not to use it ?

Yeah.  I don't see why you'd be likely to write a select that computes
columns you don't actually want.

> Tom - your proposal release of stored dataset just before next
> statement, not like now on the end of statement?

Huh?  I think you'd assign the values to the variables and then PQclear
the result right away.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: external_pid_file not removed on postmaster exit
Next
From: Robert Haas
Date:
Subject: Re: Using pg_upgrade on log-shipping standby servers