Re: Add \syncpipeline command to pgbench

2024-01-24 Thread Michael Paquier
On Tue, Jan 23, 2024 at 01:08:24PM +0900, Michael Paquier wrote: > Anyway, I wanted to study this one and learn a bit more about the > error stuff that was happening on pgbench side. Well, I've spend some time studying this part, and the error handling was looking correct based on the safety measu

Re: Add \syncpipeline command to pgbench

2024-01-22 Thread Michael Paquier
On Mon, Jan 22, 2024 at 01:59:00PM +0100, Alvaro Herrera wrote: > On 2024-Jan-22, Anthonin Bonnefoy wrote: >> 0002 adds the \syncpipeline command (original patch with an additional >> test case). > > I can look into this one later, unless Michael wants to. The patch seemed rather OK at quick glan

Re: Add \syncpipeline command to pgbench

2024-01-22 Thread Michael Paquier
On Mon, Jan 22, 2024 at 05:53:13PM +0100, Alvaro Herrera wrote: > I hope this is OK. I debated a half a dozen alternatives ("with open > pipeline", "without closing pipeline", "with unclosed pipeline" (???), > "leaving pipeline open") and decided this was the least ugly. That looks OK to me. Tha

Re: Add \syncpipeline command to pgbench

2024-01-22 Thread Alvaro Herrera
On 2024-Jan-22, Anthonin Bonnefoy wrote: > 0001 introduces a new error when the end of a pgbench script is > reached while there's still an ongoing pipeline. Pushed, backpatched to 14. I reworded the error message to be client %d aborted: end of script reached with pipeline open I hope this

Re: Add \syncpipeline command to pgbench

2024-01-22 Thread Alvaro Herrera
On 2024-Jan-22, Anthonin Bonnefoy wrote: > That looks like a bug with how opened pipelines are not caught at the > end of the script processing. startpipeline seems to have similar > related issues. Ah, yeah. Your fix looks necessary on a quick look. I'll review and see about backpatching this.

Re: Add \syncpipeline command to pgbench

2024-01-22 Thread Anthonin Bonnefoy
That looks like a bug with how opened pipelines are not caught at the end of the script processing. startpipeline seems to have similar related issues. $ cat only_startpipeline.sql \startpipeline SELECT 1; With only 1 transaction, pgbench will consider this a success despite not sending anything

Re: Add \syncpipeline command to pgbench

2024-01-21 Thread Michael Paquier
On Fri, Jan 19, 2024 at 08:55:31AM +0100, Anthonin Bonnefoy wrote: > I've updated the doc to group the commands. It does look better and > more consistent with similar command groups like \if. I was playing with a few meta command scenarios while looking at this patch, and this sequence generates

Re: Add \syncpipeline command to pgbench

2024-01-18 Thread Anthonin Bonnefoy
On Fri, Jan 19, 2024 at 5:08 AM Michael Paquier wrote: > The logic looks sound, but I have a > comment about the docs: could it be better to group \syncpipeline with > \startpipeline and \endpipeline? \syncpipeline requires a pipeline to > work. I've updated the doc to group the commands. It doe

Re: Add \syncpipeline command to pgbench

2024-01-18 Thread Michael Paquier
On Thu, Jan 18, 2024 at 09:48:28AM +0100, Anthonin Bonnefoy wrote: > PQsendSyncMessage() was added in > https://commitfest.postgresql.org/46/4262/. It allows users to add a > Sync message without flushing the buffer. > > As a follow-up, this change adds an additional meta-command to > pgbench, \sy

Add \syncpipeline command to pgbench

2024-01-18 Thread Anthonin Bonnefoy
Hi, PQsendSyncMessage() was added in https://commitfest.postgresql.org/46/4262/. It allows users to add a Sync message without flushing the buffer. As a follow-up, this change adds an additional meta-command to pgbench, \syncpipeline, which will call PQsendSyncMessage(). This will make it possibl