Re: [PATCH] Add additional extended protocol commands to psql: \parse and \bindx

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Anthonin Bonnefoy <anthonin(dot)bonnefoy(at)datadoghq(dot)com>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] Add additional extended protocol commands to psql: \parse and \bindx
Date: 2025-06-12 13:14:22
Message-ID: 3e694442-0df5-4f92-a08f-c5d4c4346b85@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 24.07.24 07:04, Michael Paquier wrote:
> This commit introduces three additional commands: \parse, \bindx and
> \close.
> \parse creates a prepared statement using extended protocol.
> \bindx binds and execute an existing prepared statement using extended
> protocol.
> \close closes an existing prepared statement using extended protocol.

I'm wondering now if \close is a good name of this command. I hadn't
seen any discussion around the name choice in this thread.

On the SQL level, the CLOSE command operates on cursors. I think it
would be useful to keep SQL and psql aligned (e.g., COPY, \copy). On
the protocol level, the "Close" message operates on both cursors and
statements, but those are actually two different message (sub-)types.
And this is not something users ever see, so the connection would not be
obvious. Maybe this should be called something more specific like
\close_stmt.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2025-06-12 13:26:10 Re: Question on error code selection in conflict detection
Previous Message Andres Freund 2025-06-12 13:13:04 Re: Non-reproducible AIO failure