Re: [HACKERS] pgbench - allow to store select results into variables

Alvaro Herrera <alvherre@2ndquadrant.com>

From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Fabien COELHO <coelho@cri.ensmp.fr>, Michael Paquier <michael@paquier.xyz>, Stephen Frost <sfrost@snowman.net>, Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2019-01-10T19:00:33Z
Lists: pgsql-hackers
On 2019-Jan-10, Tom Lane wrote:

> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > Now let's see how the buildfarm likes this ...
> 
> This \cset thing seem like an incredibly badly thought out kluge.
> What is its excuse to live?

The reason is that you can set variables from several queries in one
network trip.

We can take it out I guess, but my impression was that we already pretty
much had a consensus that it was wanted. 

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Commits

  1. pgbench: Remove \cset

  2. pgbench: add \cset and \gset commands

  3. Adjust pgbench to allow non-ASCII characters in variable names.

  4. Refactor script execution state machine in pgbench.

  5. Allow empty queries in pgbench.