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

2024-07-24 Thread Peter Eisentraut
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 s

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

2024-07-24 Thread Aleksander Alekseev
Hi, > It took me a couple of days to get back to it, but attached is what I > have finished with. This was mostly OK, except for a few things: > - \close was inconsistent with the other two commands, where no > argument was treated as the unnamed prepared statement. I think that > this should be

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

2024-07-23 Thread Michael Paquier
On Fri, Jul 19, 2024 at 03:28:44PM +0200, Tomas Vondra wrote: > OK, if you're already half-way through the review, I'll leave it up to > you. I don't think we need to rush, and I'd have to learn about all the > psql stuff first anyway. It took me a couple of days to get back to it, but attached is

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

2024-07-23 Thread Michael Paquier
On Fri, Jul 19, 2024 at 03:28:44PM +0200, Tomas Vondra wrote: > OK, if you're already half-way through the review, I'll leave it up to > you. I don't think we need to rush, and I'd have to learn about all the > psql stuff first anyway. It took me a couple of days to get back to it, but attached is

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

2024-07-19 Thread Tomas Vondra
On 7/19/24 04:23, Michael Paquier wrote: > On Fri, Jul 19, 2024 at 12:17:44AM +0200, Tomas Vondra wrote: >> shall we do something about this patch? It seems to be in a pretty good >> shape (pretty much RFC, based on quick review), the cfbot is still >> happy, and there seems to be agreement this is

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

2024-07-18 Thread Michael Paquier
On Fri, Jul 19, 2024 at 12:17:44AM +0200, Tomas Vondra wrote: > shall we do something about this patch? It seems to be in a pretty good > shape (pretty much RFC, based on quick review), the cfbot is still > happy, and there seems to be agreement this is a nice feature. > > Michael, I see you've re

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

2024-07-18 Thread Tomas Vondra
Hi, shall we do something about this patch? It seems to be in a pretty good shape (pretty much RFC, based on quick review), the cfbot is still happy, and there seems to be agreement this is a nice feature. Michael, I see you've reviewed the patch in January. Do you agree / plan to get it committe

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

2024-01-26 Thread vignesh C
On Fri, 19 Jan 2024 at 10:50, Michael Paquier wrote: > > On Thu, Jan 18, 2024 at 09:25:16AM +0100, Anthonin Bonnefoy wrote: > > From what I can tell, there's no change in the behaviour. All paths > > would eventually go through HandleSlashCmds's cleaning logic. This is > > also mentioned in ignore

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

2024-01-18 Thread Michael Paquier
On Thu, Jan 18, 2024 at 09:25:16AM +0100, Anthonin Bonnefoy wrote: > From what I can tell, there's no change in the behaviour. All paths > would eventually go through HandleSlashCmds's cleaning logic. This is > also mentioned in ignore_slash_options's comment. Yeah, I can confirm that. I would be

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

2024-01-18 Thread Anthonin Bonnefoy
> Hmm. So it does not lead to any user-visible changes, right? >From what I can tell, there's no change in the behaviour. All paths would eventually go through HandleSlashCmds's cleaning logic. This is also mentioned in ignore_slash_options's comment. * Read and discard "normal" slash command op

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

2024-01-17 Thread Michael Paquier
On Wed, Jan 17, 2024 at 10:05:33AM +0100, Anthonin Bonnefoy wrote: > > I do realize the same is true for plain \bind, but it seems > > like a bug there too. > > The unscanned bind's parameters are discarded later in the > HandleSlashCmds functions. So adding the ignore_slash_options() for > inacti

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

2024-01-17 Thread Anthonin Bonnefoy
> I do realize the same is true for plain \bind, but it seems > like a bug there too. The unscanned bind's parameters are discarded later in the HandleSlashCmds functions. So adding the ignore_slash_options() for inactive branches scans and discards them earlier. I will add it to match what's done

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

2024-01-16 Thread Michael Paquier
On Tue, Jan 16, 2024 at 10:37:22AM +0100, Jelte Fennema-Nio wrote: > I do realize the same is true for plain \bind, but it seems > like a bug there too. Hmm. ignore_slash_options() is used to make the difference between active and inactive branches with \if. I was playing a bit with psql.sql but

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

2024-01-16 Thread Jelte Fennema-Nio
On Tue, 16 Jan 2024 at 10:37, Jelte Fennema-Nio wrote: > > Looks really good now. One thing I noticed is that \bindx doesn't call > ignore_slash_options if it's not in an active branch. Afaict it > should. I do realize the same is true for plain \bind, but it seems > like a bug there too. To cov

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

2024-01-16 Thread Jelte Fennema-Nio
One more usability thing. I think \parse and \close should not require a \g to send the message. You can do that by returning PSQL_CMD_SEND instead of PSQL_CMD_SKIP_LIN. I feel like the main point of requiring \g for \bind and \bindx is so you can also use \gset or \gexec. But since \parse and \clo

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

2024-01-16 Thread Jelte Fennema-Nio
Looks really good now. One thing I noticed is that \bindx doesn't call ignore_slash_options if it's not in an active branch. Afaict it should. I do realize the same is true for plain \bind, but it seems like a bug there too.

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

2024-01-16 Thread Anthonin Bonnefoy
Hi, Thanks for the review and comments. > One thing that I think should be added for completeness though is the > ability to deallocate the prepared statement using > PQsendClosePrepared. Other than that the changes look great. Good point, I've added the \close command. > Also a tiny nitpick: st

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

2024-01-13 Thread Jelte Fennema-Nio
On Thu, 2 Nov 2023 at 10:52, Anthonin Bonnefoy wrote: > The main goal is to provide more ways to test extended protocol in > regression tests > similarly to what \bind is doing. I think this is a great addition. One thing that I think should be added for completeness though is the ability to deal