pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: psql: Add command to use extended query protocol
Date: Tue, 15 Nov 2022 13:28:47 +0000
Message-ID: <E1ouvza-000JUB-I6@gemulon.postgresql.org> (raw)

psql: Add command to use extended query protocol

This adds a new psql command \bind that sets query parameters and
causes the next query to be sent using the extended query protocol.
Example:

    SELECT $1, $2 \bind 'foo' 'bar' \g

This may be useful for psql scripting, but one of the main purposes is
also to be able to test various aspects of the extended query protocol
from psql and to write tests more easily.

Reviewed-by: Corey Huinker <corey.huinker@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/e8dd1cd5-0e04-3598-0518-a605159fe314@enterprisedb.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5b66de3433e2110b38a2b32aaaa0b9cdac8aacdb

Modified Files
--------------
doc/src/sgml/ref/psql-ref.sgml     | 36 ++++++++++++++++++++++++++++++++++++
src/bin/psql/command.c             | 37 +++++++++++++++++++++++++++++++++++++
src/bin/psql/common.c              | 15 ++++++++++++++-
src/bin/psql/help.c                |  1 +
src/bin/psql/settings.h            |  3 +++
src/bin/psql/tab-complete.c        |  1 +
src/test/regress/expected/psql.out | 31 +++++++++++++++++++++++++++++++
src/test/regress/sql/psql.sql      | 14 ++++++++++++++
8 files changed, 137 insertions(+), 1 deletion(-)



Message-ID: <E1ouvza-000JUB-I6@gemulon.postgresql.org>
Permalink:  ../E1ouvza-000JUB-I6@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ouvza-000JUB-I6@gemulon.postgresql.org

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: psql: Add command to use extended query protocol
  In-Reply-To: <E1ouvza-000JUB-I6@gemulon.postgresql.org>
  References: <E1ouvza-000JUB-I6@gemulon.postgresql.org>

* 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