Re: Adding an extra byte to ReadyForQuery (B) to indicate HOLD cursors - Mailing list pgsql-hackers

From Kirill Reshke
Subject Re: Adding an extra byte to ReadyForQuery (B) to indicate HOLD cursors
Date
Msg-id CALdSSPiAjz8h772jUaV+Ea_h+yqeqmWdU4X5Vcz3FPsuw+a+Dw@mail.gmail.com
Whole thread Raw
In response to Adding an extra byte to ReadyForQuery (B) to indicate HOLD cursors  (Hannu Krosing <hannuk@google.com>)
Responses Re: Adding an extra byte to ReadyForQuery (B) to indicate HOLD cursors
List pgsql-hackers
On Fri, 28 Nov 2025 at 14:48, Hannu Krosing <hannuk@google.com> wrote:
>
> Would it make sense to add one more byte ('H' ?) at the end of the
> ReadyForQuery backend message to indicate that there are cursors that
> live across transactions, so thet the connection pooler knows to not
> give the database connections to other clients while this is happening
> ?

This part is actually interesting when speaking about connection
proxying (pooling, e.g. pgbouncer, odyssey, pgpool-II)
If we can inform the client that his postgresql backend has some
session-level objects (like prepared statement, temp table, advisory
lock or cursor), this will be very helpful.
On the pooler side, you can reuse or not reuse connections between
different clients based on this single byte value.



-- 
Best regards,
Kirill Reshke



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Remove useless casting to the same type
Next
From: Álvaro Herrera
Date:
Subject: Re: headerscheck ccache support