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

Fabien COELHO <coelho@cri.ensmp.fr>

From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>, Stephen Frost <sfrost@snowman.net>, PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2018-08-14T11:56:29Z
Lists: pgsql-hackers
> Andrew> It's not done by my MUA, and it's present in your latest posted
> Andrew> patch. If anything I'd suspect your MUA:
>
> The patch in the original email is in text/plain with base64 transfer
> encoding, which means that CRLF line endings are mandatory. It's
> actually up to the receiving MUA (or the archives webserver) to undo
> that.

I came to the same conclusion. This is hidden because most people post 
patches as "application/octet-stream", where no meddling is allowed. I'll 
try to do that in the future.

> If the archives webserver isn't handling that then it's a bug there.

I'm not sure that the webserver is at fault either: it sends "CRLF" on 
"text/plain", which seems okay, even required, by MIME. Maybe the web 
user agent should do the translating if appropriate to the receiving 
system... Obviously "curl" does not do it, nor "firefox" on "save as".

I have no doubt that some MUA around would forget to do the conversion.

-- 
Fabien.


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.