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

From Andrew Dunstan
Subject Re: proposal - assign result of query to psql variable
Date
Msg-id 51040CA3.2070003@dunslane.net
Whole thread Raw
In response to Re: proposal - assign result of query to psql variable  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: proposal - assign result of query to psql variable
List 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



pgsql-hackers by date:

Previous
From: Phil Sorber
Date:
Subject: Re: [PATCH] pg_isready (was: [WIP] pg_ping utility)
Next
From: Tom Lane
Date:
Subject: Re: Proposal for Allow postgresql.conf values to be changed via SQL [review]