Pipelining by mcollina · Pull Request #3357 · brianc/node-postgres

@mcollina

This is a reopen of #2706, hopefully completing it soon.

displayErrors, cesco69, nigrosimone, and WilcoKruijer reacted with thumbs up emoji cesco69, breakpointninja, abenhamdine, KuhlTime, yosiat, and laurisvan reacted with hooray emoji abenhamdine, cesco69, and NathanHuisman reacted with heart emoji

@cesco69

@brianc

Just for remind, the pipeline mode should also be implemented in the pg-native client:

Also, I'm fine accepting additions in just JavaScript which can be ported to the native module at a later date if you're not comfortable working on it. Particularly if it requires c/c++ binding changes. There are several "pure javascript only" features already such as pg-cursor and pg-query-stream only supporting the pure JS client.

pls lmk how I can help out here!

@mcollina

@brianc can you approve the workflow run so we know where things are in CI?

@brianc

It doesnt give me the option while its a draft. Lemme mark it as ready and try.

Edit: nevermind. It did. Was behind a dropdown. Anyways, running now!

@brianc brianc marked this pull request as ready for review

January 23, 2025 16:54

@brianc

I changed the rules on the CI runner to be more lax & auto-run in more situations. I might still have to approve some, but shouldn't require me to approve it quite as much which is good. :)

@cesco69

Hi @mcollina,

I hope you're doing well! I wanted to kindly check if you're still interested in working on this feature. I'd really love to see it implemented, as it would be a valuable addition to the project.

I've contributed to the project myself, but unfortunately, I don't have the skills to tackle this feature. If you decide not to move forward with it, that's completely understandable, your time and efforts on so many projects like Fastify are truly appreciated!

Thanks again for your contributions.

@mcollina

I'll get to it at some point ;). If anyone has bandwidth, happy to collaborate

@breakpointninja

Hi @mcollina and @brianc,

Thank you for your work on node-postgres.

I'm very interested in the query pipelining feature in this PR. I've reviewed the code and would like to help get it merged.

What are the most important next steps? I'm happy to help with tests, exploring the native client implementation, or any other remaining tasks.

Looking forward to collaborating with you.

@cesco69

Side note for those who want to try finishing this PR:

The current implementation relies only on prepared statements (named queries) to connect the result to the correct query, but this is not mandatory.

Every query can be "pipelined", e.g., other clients use the hash (SHA-1) of the query to return the correct result.

I have tried (and failed) to extend pipeline mode to every query in this PR: #3534

This was referenced

Oct 14, 2025