Re: pgbench - add \aset to store results of a combined query - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: pgbench - add \aset to store results of a combined query
Date
Msg-id alpine.DEB.2.21.1911291013490.12886@pseudo
Whole thread Raw
In response to Re: pgbench - add \aset to store results of a combined query  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pgbench - add \aset to store results of a combined query  (David Steele <david@pgmasters.net>)
Re: pgbench - add \aset to store results of a combined query  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Michaël,

> +   bool        aset;
>
> It seems to me that there is no point to have the variable aset in 
> Command because this structure includes already MetaCommand, so the 
> information is duplicated. [...] Perhaps I am missing something?

Yep. ISTM that you are missing that aset is not an independent meta 
command like most others but really changes the state of the previous SQL 
command, so that it needs to be stored into that with some additional 
fields. This is the same with "gset" which is tagged by a non-null 
"varprefix".

So I cannot remove the "aset" field.

> And I would suggest to change readCommandResponse() to use a MetaCommand 
> in argument.

MetaCommand is not enough: we need varprefix, and then distinguishing 
between aset and gset. Although this last point can be done with a 
MetaCommand, ISTM that a bool is_aset is clear and good enough. It is 
possible to switch if you insist on it, but I do not think it is 
desirable.

Attached v4 removes an unwanted rebased comment duplication and does minor 
changes while re-reading the code.

-- 
Fabien.
Attachment

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: allow_system_table_mods stuff
Next
From: Amit Kapila
Date:
Subject: Re: dropdb --force