Repository navigation
docs: clarify role reset for pooled connections - #1403
Open
JackyHsu-X wants to merge 1 commit into
Open
JackyHsu-X wants to merge 1 commit into
JackyHsu-X wants to merge 1 commit into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Connection.reset()currently says that all session configuration variables are reset. However, the default query usesRESET ALL, which does not undo a committed session-levelSET ROLE. Releasing a connection to a pool can therefore leave its role in effect for the next acquirer.Related to #1402. This addresses the documentation option in that issue; it leaves the decision about changing the default reset behavior open.
Change
RESET ALLrather than every session variable.conn.reset()beforeRESET ROLE, preserving default cleanup and handling an aborted transaction.RESET ROLErestores a connection-time role setting when present, and that a role needed on each acquisition belongs insetup, rather thaninit.Only two API docstrings change; executable Python ASTs are unchanged.
Validation
server_settings, andinitonce versussetupon both acquisitions.git diff --checkpasses. Full runtime tests were not run for this documentation-only change.PostgreSQL documents the connection-time behavior of
RESET ROLEin SET ROLE.AI disclosure: OpenAI Codex prepared the patch, example verification and PR text, and ran the listed checks. This does not claim human review by the account owner.