Re: proposal - assign result of query to psql variable

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: David Fetter <david(at)fetter(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal - assign result of query to psql variable
Date: 2012-07-27 05:49:28
Message-ID: 25376.1343368168@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> 2012/7/26 David Fetter <david(at)fetter(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2012-07-27 12:24:54 Re: Using pg_upgrade on log-shipping standby servers
Previous Message Peter Eisentraut 2012-07-27 05:09:10 external_pid_file not removed on postmaster exit