pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pgbench: add \cset and \gset commands
Date: Thu, 10 Jan 2019 16:42:49 +0000
Message-ID: <E1ghdPt-0001P1-8U@gemulon.postgresql.org> (raw)

pgbench: add \cset and \gset commands

These commands allow assignment of values produced by queries to pgbench
variables, where they can be used by further commands.  \gset terminates
a command sequence (just like a bare semicolon); \cset separates
multiple queries in a compound command, like an escaped semicolon (\;).
A prefix can be provided to the \-command and is prepended to the name
of each output column to produce the final variable name.

This feature allows pgbench scripts to react meaningfully to the actual
database contents, allowing more powerful benchmarks to be written.

Authors: Fabien Coelho, Álvaro Herrera
Reviewed-by: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Reviewed-by: Stephen Frost <sfrost@snowman.net>
Reviewed-by: Pavel Stehule <pavel.stehule@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Tatsuo Ishii <ishii@sraoss.co.jp>
Reviewed-by: Rafia Sabih <rafia.sabih@enterprisedb.com>
Discussion: https://postgr.es/m/alpine.DEB.2.20.1607091005330.3412@sto

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/6260cc550b0e60052168518a0338e440b67cf24e

Modified Files
--------------
doc/src/sgml/ref/pgbench.sgml                |  85 +++++
src/bin/pgbench/pgbench.c                    | 545 ++++++++++++++++++++-------
src/bin/pgbench/t/001_pgbench_with_server.pl |  82 +++-
src/fe_utils/psqlscan.l                      |  24 +-
src/include/fe_utils/psqlscan.h              |   2 +
src/include/fe_utils/psqlscan_int.h          |   1 +
6 files changed, 602 insertions(+), 137 deletions(-)



Message-ID: <E1ghdPt-0001P1-8U@gemulon.postgresql.org>
Permalink:  ../E1ghdPt-0001P1-8U@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ghdPt-0001P1-8U@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: pgbench: add \cset and \gset commands
  In-Reply-To: <E1ghdPt-0001P1-8U@gemulon.postgresql.org>
  References: <E1ghdPt-0001P1-8U@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox