News for hackers. Stuff that matters.
Re:Scalable PostgreSQL Connection Pooler by x4m on Friday November 12, 2021 @01:11PM (#29202597)
This may sound naive, but implementing your own pooler is very easy e.g. in Go pgproto3 already does all packet-parsing for you. Transaction poolers are looking on ReadyForQuery packet and it's "in trnsaction" property like this [0]. All you need - is stick server connection on new ParameterStatus[1] packet for "SET search_path" instead of ReadyForQuery.

[0] https://github.com/pg-sharding/spqr/blob/358f816cd8a964a9c9e... [1] https://www.postgresql.org/docs/10/protocol-flow.html#id-1.1...

Re:Scalable PostgreSQL Connection Pooler by CyberDem0n on Friday November 12, 2021 @02:16PM (#29203416)
It's not enough to intercept `set search_path`, in fact any arbitrary function could change it, but Postgres doesn't report it back, unlike some other gucs.
Re:Scalable PostgreSQL Connection Pooler by x4m on Friday November 12, 2021 @02:35PM (#29203602)
Hmm, yes. ParameterStatus is not sent when search_path is changed. But I think it would be trivial to patch PostgreSQL to send it. I bet one even can push such patch through commitfest.