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

2024-09-19 Thread Michael Paquier
On Thu, Sep 19, 2024 at 10:53:07AM +0200, Jelte Fennema-Nio wrote: > Seems like a good idea to add a simple test for that behaviour then. > See attached. Thanks. The same can be said for \bind_named, so I have added something for both \bind and \bind_named. -- Michael signature.asc Description:

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

2024-09-19 Thread Jelte Fennema-Nio
On Thu, 19 Sept 2024 at 09:30, Michael Paquier wrote: > Issuing an error if there is a state does not sound like a good idea > at this stage because it would suddenly break scripts that expect > multiple commands of \bind to prioritize the last one. Seems like a good idea to add a simple test for

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

2024-09-19 Thread Michael Paquier
On Wed, Sep 18, 2024 at 06:08:54PM +0900, Michael Paquier wrote: > On Wed, Sep 18, 2024 at 09:42:43AM +0200, Anthonin Bonnefoy wrote: >> I've joined a patch to clean the psql extended state at the start of >> every extended protocol backslash command, freeing the allocated >> variables and resettin

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

2024-09-18 Thread Michael Paquier
On Wed, Sep 18, 2024 at 09:42:43AM +0200, Anthonin Bonnefoy wrote: > Looking at the failure, it seems like the issue was already present > with \bind, though there was no assertion failure: repeatedly calling > \bind would allocate new stmtName/bind_params and leak them at the > start of exec_comma

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

2024-09-18 Thread Anthonin Bonnefoy
On Tue, Sep 17, 2024 at 5:00 PM Alexander Lakhin wrote: > > Please look at an assertion failure, caused by \bind_named: > regression=# SELECT $1 \parse s > \bind_named s > > regression=# \bind_named > \bind_named: missing required argument > regression=# 1 \g > psql: common.c:1501: ExecQueryAndPro

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

2024-09-17 Thread Alexander Lakhin
Hello Michael and Anthonin, 22.08.2024 10:33, Michael Paquier wrote: 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

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

2024-08-22 Thread Michael Paquier
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 r

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

2024-08-21 Thread Anthonin Bonnefoy
On Wed, Aug 21, 2024 at 12:00 AM Jelte Fennema-Nio wrote: > @Anthonin are you planning to update the patch accordingly? Here's the patch with \bindx renamed to \bind_named. I've also made a small change to Michael's refactoring in 0002 by initialising success to false in ExecQueryAndProcessResul

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

2024-08-20 Thread Jelte Fennema-Nio
On Thu, 25 Jul 2024 at 08:45, Anthonin Bonnefoy wrote: > +1 keeping this as a separate command and using \bind_named. \bind has > a different behaviour as it also parses the query so keeping them as > separate commands would probably avoid some confusion. +1 on naming it \bind_named @Anthonin ar

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

2024-07-24 Thread Anthonin Bonnefoy
On Wed, Jul 24, 2024 at 05:33:07PM +0200, Peter Eisentraut wrote: > This commit message confused me, because I don't think this is what the > \bindx command actually does. AFAICT, it only binds, it does not execute. > At least that is what the documentation in the content of the patch appears > to

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

2024-07-24 Thread Michael Paquier
On Wed, Jul 24, 2024 at 05:33:07PM +0200, Peter Eisentraut wrote: > This commit message confused me, because I don't think this is what the > \bindx command actually does. AFAICT, it only binds, it does not execute. > At least that is what the documentation in the content of the patch appears > to