public inbox for [email protected]  
help / color / mirror / Atom feed
Pipeline Mode vs Single Row Mode / Chunked Rows Mode
4+ messages / 3 participants
[nested] [flat]

* Pipeline Mode vs Single Row Mode / Chunked Rows Mode
@ 2024-12-19 14:36 Daniel Frey <[email protected]>
  2025-01-02 08:48 ` Re: Pipeline Mode vs Single Row Mode / Chunked Rows Mode Dominique Devienne <[email protected]>
  2025-01-06 19:47 ` Re: Pipeline Mode vs Single Row Mode / Chunked Rows Mode Daniel Verite <[email protected]>
  0 siblings, 2 replies; 4+ messages in thread

From: Daniel Frey @ 2024-12-19 14:36 UTC (permalink / raw)
  To: pgsql-general <[email protected]>

Hi,

I'm adding support for Pipeline Mode to my C++ PostgreSQL client library (https://github.com/taocpp/taopq) and I tried to understand the interaction between Pipeline Mode and Single Row Mode / Chunked Rows Mode. It seems that it works sometimes, but I don't get the feeling that it was deliberately designed to work consistently. Example:

* Consider a table with three rows of data
* I send two (identical) SELECT commands, e.g. "SELECT * FROM test_table"
* I call PQpipelineSync()
* I call PQsetSingleRowMode()
* I read the results, I get
  * One result with size 1
  * Another one with size 1
  * Another one with size 1
  * A final one with size 0 for the first select
  * A result with size 3 for the second select
  * A result with PGRES_PIPELINE_SYNC

When I try to call PQsetSingleRowMode() for the second SELECT, it fails.
It also seems weird that I can call it for the first result after the sync call, but maybe that's OK?

Anyway, is there some documentation about how these modes interact and how they can be combined? Or should they never be combined?

-Daniel







^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Pipeline Mode vs Single Row Mode / Chunked Rows Mode
  2024-12-19 14:36 Pipeline Mode vs Single Row Mode / Chunked Rows Mode Daniel Frey <[email protected]>
@ 2025-01-02 08:48 ` Dominique Devienne <[email protected]>
  1 sibling, 0 replies; 4+ messages in thread

From: Dominique Devienne @ 2025-01-02 08:48 UTC (permalink / raw)
  To: Daniel Frey <[email protected]>; +Cc: pgsql-general <[email protected]>

On Thu, Dec 19, 2024 at 3:37 PM Daniel Frey <[email protected]> wrote:
> I'm adding support for Pipeline Mode to my C++ PostgreSQL client library [...]
> Anyway, is there some documentation about how these modes interact and how they can be combined? Or should they never be combined?

Hi. Happy New Year. I was interested in that question as well, having
played with Pipeline mode a bit, but not Single Row mode yet. Any
insights? --DD






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Pipeline Mode vs Single Row Mode / Chunked Rows Mode
  2024-12-19 14:36 Pipeline Mode vs Single Row Mode / Chunked Rows Mode Daniel Frey <[email protected]>
@ 2025-01-06 19:47 ` Daniel Verite <[email protected]>
  2025-01-07 15:28   ` Re: Pipeline Mode vs Single Row Mode / Chunked Rows Mode Daniel Frey <[email protected]>
  1 sibling, 1 reply; 4+ messages in thread

From: Daniel Verite @ 2025-01-06 19:47 UTC (permalink / raw)
  To: Daniel Frey <[email protected]>; +Cc: pgsql-general <[email protected]>

	Daniel Frey wrote:

> I tried to understand the interaction between Pipeline Mode and
> Single Row Mode / Chunked Rows Mode. It seems that it works
> sometimes, but I don't get the feeling that it was deliberately
> designed to work consistently

It's supposed to work, and there are regression tests in
src/test/modules/libpq_pipeline/libpq_pipeline.c [1]
that exercise the single row mode and PQpipelineSync().

You might want to compare your code workflow with how it's done in
that file, and maybe submit a bug report with your test case if the
conclusion is that your code should not error out.


[1]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/test/modules/libpq_pipeline/libpq_p...

Best regards,
-- 
Daniel Vérité
https://postgresql.verite.pro/
Twitter: @DanielVerite






^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Pipeline Mode vs Single Row Mode / Chunked Rows Mode
  2024-12-19 14:36 Pipeline Mode vs Single Row Mode / Chunked Rows Mode Daniel Frey <[email protected]>
  2025-01-06 19:47 ` Re: Pipeline Mode vs Single Row Mode / Chunked Rows Mode Daniel Verite <[email protected]>
@ 2025-01-07 15:28   ` Daniel Frey <[email protected]>
  0 siblings, 0 replies; 4+ messages in thread

From: Daniel Frey @ 2025-01-07 15:28 UTC (permalink / raw)
  To: Daniel Verite <[email protected]>; +Cc: pgsql-general <[email protected]>

> On 6. Jan 2025, at 20:47, Daniel Verite <[email protected]> wrote:
> 
> Daniel Frey wrote:
> 
>> I tried to understand the interaction between Pipeline Mode and
>> Single Row Mode / Chunked Rows Mode. It seems that it works
>> sometimes, but I don't get the feeling that it was deliberately
>> designed to work consistently
> 
> It's supposed to work, and there are regression tests in
> src/test/modules/libpq_pipeline/libpq_pipeline.c [1]
> that exercise the single row mode and PQpipelineSync().
> 
> You might want to compare your code workflow with how it's done in
> that file, and maybe submit a bug report with your test case if the
> conclusion is that your code should not error out.

Thank you for the link, I will need some time to investigate and to figure out what is different.

Best, Daniel







^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2025-01-07 15:28 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-12-19 14:36 Pipeline Mode vs Single Row Mode / Chunked Rows Mode Daniel Frey <[email protected]>
2025-01-02 08:48 ` Dominique Devienne <[email protected]>
2025-01-06 19:47 ` Daniel Verite <[email protected]>
2025-01-07 15:28   ` Daniel Frey <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox