psql: Add command to use extended query protocol

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: psql: Add command to use extended query protocol
Date: 2022-10-28 06:52:51
Message-ID: e8dd1cd5-0e04-3598-0518-a605159fe314@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This adds a new psql command \gp that works like \g (or semicolon) but
uses the extended query protocol. Parameters can also be passed, like

SELECT $1, $2 \gp 'foo' 'bar'

I have two main purposes for this:

One, for transparent column encryption [0], we need a way to pass
protocol-level parameters. The present patch in the [0] thread uses a
command \gencr, but based on feedback and further thinking, a
general-purpose command seems better.

Two, for testing the extended query protocol from psql. For example,
for the dynamic result sets patch [1], I have several ad-hoc libpq test
programs lying around, which would be cumbersome to integrate into the
patch. With psql support like proposed here, it would be very easy to
integrate a few equivalent tests.

Perhaps this would also be useful for general psql scripting.

[0]: https://commitfest.postgresql.org/40/3718/
[1]: https://commitfest.postgresql.org/40/2911/

Attachment Content-Type Size
0001-psql-Add-command-to-use-extended-query-protocol.patch text/plain 9.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Erik Rijkers 2022-10-28 06:54:29 Re: Code checks for App Devs, using new options for transaction behavior
Previous Message Peter Smith 2022-10-28 06:50:05 Re: Support logical replication of DDLs