Re: psql: Add command to use extended query protocol

Daniel Verite <daniel@manitou-mail.org>

From: "Daniel Verite" <daniel@manitou-mail.org>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Pavel Stehule <pavel.stehule@gmail.com>, Corey Huinker <corey.huinker@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Pgsql-Hackers <pgsql-hackers@postgresql.org>
Date: 2022-11-08T12:02:17Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. psql: Add command to use extended query protocol

	David G. Johnston wrote:

> I would keep the \gp meta-command to force extended mode regardless
> of whether the query itself requires it.

+1

> A pset variable to control the default seems reasonable as well.
> The implication would be that if you set that pset variable there is
> no way to have individual commands use simple query mode directly.

+1 except that it would be a \set variable for consistency with the
other execution-controlling variables. \pset variables control only
the display.

BTW if we wanted to auto-detect that a query requires binding or the
extended query protocol, we need to keep in mind that for instance
"PREPARE stmt AS $1" must pass without binding, with both the simple
and the extended query protocol.


Best regards,
-- 
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite