Re: proposal - assign result of query to psql variable

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Shigeru Hanada <shigeru(dot)hanada(at)gmail(dot)com>, Phil Sorber <phil(at)omniti(dot)com>, Erik Rijkers <er(at)xs4all(dot)nl>, 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: 2013-01-26 17:04:35
Message-ID: 51040CA3.2070003@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 01/26/2013 11:42 AM, Tom Lane wrote:

> A probably-useful extension to this basic concept is to allow \gset
> to specify an optional prefix, that is
> select 1 as x, 2 as y \gset p_
> would set p_x and p_y. This would make it easier to manage results from
> multiple \gset operations, and to be sure that you didn't accidentally
> overwrite some built-in variable.

+1. This looks quite nifty. Maybe useful too to have a default prefix
via some setting.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Anderson C. Carniel 2013-01-26 17:14:34 error C2011 in Visual Studio 2012
Previous Message Tom Lane 2013-01-26 17:01:59 Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]