Re: proposal - assign result of query to psql variable

From: "Erik Rijkers" <er(at)xs4all(dot)nl>
To: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
Cc: "Shigeru HANADA" <shigeru(dot)hanada(at)gmail(dot)com>, "David Fetter" <david(at)fetter(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal - assign result of query to psql variable
Date: 2012-10-13 22:11:14
Message-ID: d9346e05c3b8de0fe4b44ef8737aec87.squirrel@webmail.xs4all.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, October 13, 2012 19:26, Pavel Stehule wrote:
> 2012/10/13 Shigeru HANADA <shigeru(dot)hanada(at)gmail(dot)com>:
>> After you determine whether it's ok or unnecessary, I'll mark this patch as
>> "Ready for committer".
>>
>

I found this behaviour which I think must count as a bug.
\gset doesn't allow more \\-separated lines behind it:

Only the last of these commands is problematic, and giving the syntax error

$ psql
psql (9.3devel-psql_var-20121012_2345-8b728e5c6e0ce6b6d6f54b92b390f14aa1aca6db)
Type "help" for help.

testdb=# select 1,2 \gset x,y
testdb=# \echo :x
1
testdb=# \echo :y
2
testdb=# \echo :x \\ \echo :y
1
2
testdb=# select 1,2 \gset x,y \\ \echo :x
\gset: syntax error
testdb=#

It'd be nice if it could be made to work

Thanks

Erik Rijkers

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2012-10-13 23:55:38 Re: pg_stat_lwlocks view - lwlocks statistics, round 2
Previous Message Phil Sorber 2012-10-13 21:19:52 [WIP] pg_ping utility