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

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Cc: Jelte Fennema-Nio <postgres@jeltef.nl>, Peter Eisentraut <peter@eisentraut.org>, Tomas Vondra <tomas.vondra@enterprisedb.com>, vignesh C <vignesh21@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2024-08-22T07:33:54Z
Lists: pgsql-hackers
On Wed, Aug 21, 2024 at 09:29:04AM +0200, Anthonin Bonnefoy wrote:
> Here's the patch with \bindx renamed to \bind_named.

Looks OK to me.  I have spent more time double-checking the whole, and
it looks like we're there, so applied.  Now let's play with it in more
regression tests.  Note that the refactoring patch has been merged
with the original one in a single commit.

> I've also made a small change to Michael's refactoring in 0002 by
> initialising success to false in ExecQueryAndProcessResults. There was
> a compiler warning about success possibly used uninitialized[1].
> 
> [1] https://cirrus-ci.com/task/6207675187331072

Ah, thanks!  I've missed this one.  I see where my mistake was.
--
Michael

Commits

  1. psql: Rename meta-command \close to \close_prepared

  2. psql: Add tests for repeated calls of \bind[_named]

  3. psql: Fix memory leak with repeated calls of \bind

  4. psql: Clean up more aggressively state of \bind[_named], \parse and \close

  5. psql: Add more meta-commands able to use the extended protocol

  6. psql: Add ignore_slash_options in bind's inactive branch