Re: psql: Add command to use extended query protocol

From: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql: Add command to use extended query protocol
Date: 2022-11-01 09:10:20
Message-ID: CANbhV-Es82bUfrwz5-_1fcxHGxFjiAbMYtkm1-yPwyGUWMK8vQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 28 Oct 2022 at 07:53, Peter Eisentraut
<peter(dot)eisentraut(at)enterprisedb(dot)com> wrote:
>
> 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'

+1 for the concept. The patch looks simple and complete.

I find it strange to use it the way you have shown above, i.e. \gp on
same line after a query.

For me it would be clearer to have tests and docs showing this
SELECT $1, $2
\gp 'foo' 'bar'

> Perhaps this would also be useful for general psql scripting.

...since if we used this in a script, it would be used like this, I think...

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

--
Simon Riggs http://www.EnterpriseDB.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2022-11-01 09:33:24 Re: pg15 inherited stats expressions: cache lookup failed for statistics object
Previous Message Simon Riggs 2022-11-01 08:59:33 Re: Commit fest 2022-11