Repository navigation
Conversation
…n_session_timeout with the native client The native client connects with a libpq connection string, and getLibpqConnectionString did not include these three settings, so they were silently ignored: `SHOW statement_timeout` returned 0 whatever the config said. libpq has no connection keyword for them, so they are appended to `options` as `-c name=value`. They go after the user's own options so that they take precedence, as they already do with the JavaScript client, where they are sent as startup parameters. The statement_timeout and idle_in_transaction_session_timeout integration tests now run with the native client too. Fixes brianc#2103 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
charmander
approved these changes
Dec 3, 2026
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.
With the native client,
statement_timeout,lock_timeoutandidle_in_transaction_session_timeoutare silently ignored:The JavaScript client sends them as startup parameters, but the native client connects with a libpq connection string, and
getLibpqConnectionStringleaves them out.Change
libpq has no connection keyword for these settings, so they are appended to
optionsas-c name=value. They are placed after the user's ownoptions, so the dedicated setting wins over the same setting insideoptions. That is what already happens with the JavaScript client, where the server applies the startup parameters afteroptions.Values go through
parseInt, as inClient#getStartupConf, so numbers, floats and numeric strings behave the same with both clients.Tests
options, andoptionsonly.statement_timeoutandidle_in_transaction_session_timeoutintegration tests were skipped with the native client ("not supported with the native client"). They now run with both.Locally I ran the new unit tests and those two integration files, with the native and the JavaScript client, against PostgreSQL. I did not run the whole suite.
Notes
optionsas a startup parameter unless it is listed inignore_startup_parameters. It already rejects the same timeouts when they come from the JavaScript client, so the two clients now behave alike there too.Fixes #2103. Supersedes #2323, which has conflicts with
masterand predateslock_timeout.🤖 Generated with Claude Code