Skip to content
Discussion options

You must be logged in to vote

Your design is sound, and the guarantee you're looking for is actually stronger than pooler behavior — it comes from Postgres itself.

1. Connection ownership during a transaction: yes. In transaction mode the transaction is the unit of multiplexing — a server connection is assigned to one client at BEGIN and isn't handed to anyone else until that transaction ends with COMMIT/ROLLBACK. Interleaving two clients' statements inside one open transaction would break transaction semantics entirely; no transaction-mode pooler does that.

2. But you don't even need to trust the pooler for SET LOCAL. set_config(..., true) / SET LOCAL is scoped to the transaction by the Postgres server: the value is …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@EdouardSence
Comment options

Answer selected by EdouardSence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants