PostgreSQL: allow connection parameters to be specified#7579
Merged
eradman merged 1 commit intogetredash:masterfrom Nov 26, 2025
Merged
PostgreSQL: allow connection parameters to be specified#7579eradman merged 1 commit intogetredash:masterfrom
eradman merged 1 commit intogetredash:masterfrom
Conversation
04a9886 to
a8d5d96
Compare
Contributor
yoshiokatsuneo
left a comment
There was a problem hiding this comment.
Thank you for the PR !
redash/query_runner/pg.py
Outdated
| @@ -138,6 +138,15 @@ def _get_ssl_config(configuration): | |||
| return ssl_config | |||
|
|
|||
|
|
|||
| def _libpq_params(configuration): | |||
| standard_params = {"user", "password", "host", "port", "dbname"} | |||
| params = psycopg2.extensions.parse_dsn(configuration.get("libpq_params", "")) | |||
Contributor
There was a problem hiding this comment.
I just feel it is more natural to set configuration name to like "connection_string" (or "dsn"? ) instead of "libpq_params", as that is the string set in the configuration and passed to the parse_dsn function. How do you feel ?
https://www.psycopg.org/docs/extensions.html#psycopg2.extensions.parse_dsn
Collaborator
Author
There was a problem hiding this comment.
Adjusted to use the name "dsn"--this name probably is the best because it suggests the format this string should use.
As documented in https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS Multiple parameters are separated by a space.
a8d5d96 to
8b4929a
Compare
yoshiokatsuneo
approved these changes
Nov 26, 2025
Contributor
yoshiokatsuneo
left a comment
There was a problem hiding this comment.
Thank you!
I confirmed that I can connect to PostgreSQL of Redash without problem.
eradman
added a commit
to StarfishStorage/redash
that referenced
this pull request
Nov 26, 2025
As documented in https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS Multiple parameters are separated by a space.
woogakoki
added a commit
to wooga/redash
that referenced
this pull request
Feb 25, 2026
* master: (69 commits) Update Python version to 3.13 (getredash#7636) Update plotly.js to 3.3.1, react-pivottable to 0.11.0 (getredash#7634) Add charset option to RDS MySQL datasource (getredash#7616) Aggregate y value for same x (getredash#7631) fix(mysql): Change default charset to utf8mb4 (getredash#7615) Update packages for compatibility with setuptools 82 (getredash#7622) Snapshot: 26.02.0-dev chore: support ipv6 for server in docker (getredash#7596) Add impersonation option in trino datasource (getredash#7605) Fix Elasticsearch connector configuration key mismatch (getredash#7607) duckdb: Show catalog (database) where applicable (e.g. Motherduck) (getredash#7599) Snapshot: 26.01.0-dev Feature/catch notsupported exception (getredash#7573) Multi-org: format base path, not including protocol (getredash#7260) fix(destinations): Handle unicode characters in webhook notifications (getredash#7586) Persist updated values and apply saved dashboard parameters (getredash#7570) Add ibm-db package to enable DB2 as datasource: (getredash#7581) Snapshot: 25.12.0-dev PostgreSQL: allow connection parameters to be specified (getredash#7579) Add lineShape option for Line and Area charts (getredash#7582) ...
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.
What type of PR is this?
Description
Allow extra PostgreSQL connection parameters to be specified, as documented in
https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS
Multiple parameters are separated by a space.
How is this tested?
Related Tickets & Documents
#7578
Mobile & Desktop Screenshots/Recordings (if there are UI changes)