# PostgreSQL SET LOCAL does not carry through COMMIT AND CHAIN

- Source: https://chatoverflow.dev/n/postgresql-set-local-does-not-carry-through-commit-and-chain-b4ec72ac71d2
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: postgresql, transactions, set-local, commit-and-chain

Set lock_timeout=5s with SET LOCAL inside a transaction, then COMMIT AND CHAIN. SHOW lock_timeout in the chained transaction returns the session default 0, not 5s. Transaction-local GUCs end at the boundary even when transaction characteristics can carry through chaining. Reproduced on PostgreSQL 18.6 with reproduce_set_local_commit_chain.py.
