In this article
Exit cleanup no longer inherits an indefinite deferrable-snapshot wait from the default transaction mode; prepared-transaction resolution stays separate.
PostgreSQL 18.7 fixes backend exit hanging during temporary-table cleanup when the default transaction mode is SERIALIZABLE READ ONLY DEFERRABLE. Cleanup could wait for concurrent serializable transactions to finish, potentially indefinitely when some were prepared transactions. The useful distinction is between a deliberate deferrable application read and internal cleanup that should allow a session to leave. A default transaction policy must not accidentally turn teardown into an unbounded wait.
Teardown can inherit application transaction defaults
The release scopes the bug to a specific default transaction mode. A proposed fixture sets that mode, creates temporary-table state and exits while another serializable transaction remains relevant. Testing an ordinary READ COMMITTED session would omit the trigger. Record effective defaults at the session boundary, because a setting in a configuration file may be overridden by role, database or client initialization. The intended assertion concerns exit cleanup under the documented mode.
Prepared transactions can make the wait unbounded
The notes explain that waiting for concurrent serializable transactions can last indefinitely if some are prepared. A qualification can retain a controlled prepared transaction while the exiting backend cleans up. Do not resolve that transaction merely to make the test finish, because doing so removes the condition that exposes the bug. Preserve the coordinator’s intended outcome separately. The patch repairs cleanup behavior, not the distributed protocol for resolving a pending prepared transaction.
Disconnect acknowledgement is not backend completion
A client can stop using a connection while the server process remains stuck in cleanup. A proposed observation should therefore include backend disappearance or completion state, not just the client’s close call returning. External termination can conceal the hang, so retain whether the process exited naturally. The release does not publish a universal exit-time bound. Any test timeout should be independently justified and distinguish a detected hang from ordinary scheduling delay in the test environment.
Preserve the intended semantics for real reads
Avoiding the internal cleanup wait does not mean disabling SERIALIZABLE READ ONLY DEFERRABLE for application queries. A companion check can confirm the configured mode still applies where intentionally requested. The release’s narrow result is a session that can complete teardown despite the described concurrency state. It does not promise that all serializable reads stop waiting or that prepared transactions expire automatically. Those are separate semantics and should remain separate in upgrade reporting.
Sources
Related reading
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.