From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Fabien COELHO <coelho@cri.ensmp.fr>
Cc: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Tatsuo Ishii <ishii@sraoss.co.jp>
Cc: rafia.sabih@enterprisedb.com, Michael Paquier <michael.paquier@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL Developers <pgsql-hackers@postgresql.org>
Subject: Re: [HACKERS] pgbench - allow to store select results into variables
Date: Fri, 16 Nov 2018 18:43:07 -0300
Message-ID: <20181116214307.uhpir3nvwuvjftxa@alvherre.pgsql> (raw)
In-Reply-To: <alpine.DEB.2.20.1710251209330.24229@lancre>
On 2017-Nov-04, Fabien COELHO wrote:
> Think of one initialization followed by two appends:
>
> SELECT 1 AS x \cset
> SELECT 2 \; SELECT 3 AS y \cset
> SELECT 4 \; SELECT 5 \; SELECT 6 AS z \gset
>
> In the end, we must have the full 6 queries
>
> "SELECT 1 AS x \; SELECT 2 \; SELECT 3 AS y \; SELECT 4 \; SELECT 5 \; SELECT 6 AS z"
>
> and know that we want to set variables from queries 1, 3 and 6 and ignore
> the 3 others.
I'm not sure I understand this. Why is the "SELECT 2" ignored? (I can
see why the 4 and 5 are ignored: they are not processed by gset).
What exactly does \cset do? I thought "SELECT 2 \; SELECT 3 AS y \cset"
would search for the \; and process *both* queries.
I think the doc addition should be split.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: alvherre@2ndquadrant.com, coelho@cri.ensmp.fr, pavel.stehule@gmail.com, ishii@sraoss.co.jp, michael.paquier@gmail.com, tgl@sss.pgh.pa.us, Langote_Amit_f8@lab.ntt.co.jp, robertmhaas@gmail.com
Subject: Re: [HACKERS] pgbench - allow to store select results into variables
In-Reply-To: <20181116214307.uhpir3nvwuvjftxa@alvherre.pgsql>
* 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