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: Erik Rijkers <er(at)xs4all(dot)nl>, Shigeru HANADA <shigeru(dot)hanada(at)gmail(dot)com>, 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-10-14 21:13:40
Message-ID: 3668.1350249220@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:
> [ gset_08.diff ]

In the course of adding a new backslash command, this patch manages to
touch:

* the main loop's concept of what types of backslash commands exist
(PSQL_CMD_NOSEND ... what's the point of that, rather than making
this work the same as \g?)
* SendQuery's concept of how to process command results (again, why
isn't this more like \g?)
* ExecQueryUsingCursor's concept of how to process command results
(why? surely we don't need \gset to use a cursor)
* the psql lexer (adding a whole bunch of stuff that probably doesn't
belong there)
* the core psql settings construct (to store something that is in
no way a persistent setting)

Surely there is a less ugly and invasive way to do this. The fact
that the reviewer keeps finding bizarre bugs like "another backslash
command on the same line doesn't work" seems to me to be a good
indication that this is touching things it shouldn't.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Brar Piening 2012-10-14 21:13:46 Re: Visual Studio 2012 RC
Previous Message Boszormenyi Zoltan 2012-10-14 20:31:10 Re: [PATCH] Make pg_basebackup configure and start standby [Review]