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

From Pavel Stehule
Subject Re: proposal - assign result of query to psql variable
Date
Msg-id CAFj8pRBSVfmsTt_A6Qi2RoPREt_CR97wevSmWpyYbw9f4CcWHA@mail.gmail.com
Whole thread Raw
In response to Re: proposal - assign result of query to psql variable  ("Erik Rijkers" <er@xs4all.nl>)
Responses Re: proposal - assign result of query to psql variable  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hello

2012/10/14 Erik Rijkers <er@xs4all.nl>:
> On Sat, October 13, 2012 19:26, Pavel Stehule wrote:
>> 2012/10/13 Shigeru HANADA <shigeru.hanada@gmail.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
>

done

Regards

Pavel



> Thanks
>
> Erik Rijkers
>

Attachment

pgsql-hackers by date:

Previous
From: Stirling Newberry
Date:
Subject: Re: Deprecating RULES
Next
From: Shigeru HANADA
Date:
Subject: Re: proposal - assign result of query to psql variable