Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The connection URL ?application_name= param can't be parsed. #160

Open
pylead opened this issue May 6, 2022 · 0 comments
Open

The connection URL ?application_name= param can't be parsed. #160

pylead opened this issue May 6, 2022 · 0 comments

Comments

@pylead
Copy link

pylead commented May 6, 2022

The sqlalchemy connection URL like postgresql://user:[email protected]:6666/db?application_name=app can not be parsed correctly because of the regexp:

/^postgres(?:ql)?:\/\/([^:]*):([^@]*)@(.*?):(.*?)\/(.*?)$/'

This leads to an error like:

ERROR: database "db?application_name=app" does not exist

Optional query parameters should be ignored during the connection URL parsing.

See also:

application_name (string)
The application_name can be any string of less than NAMEDATALEN characters (64 characters in a standard build). It is typically set by an application upon connection to the server. The name will be displayed in the pg_stat_activity view and included in CSV log entries. It can also be included in regular log entries via the log_line_prefix parameter. Only printable ASCII characters may be used in the application_name value. Other characters will be replaced with question marks (?).
https://www.postgresql.org/docs/14/runtime-config-logging.html#GUC-APPLICATION-NAME

@pylead pylead changed the title The connection URL ?application_name= parameter adding can not be parsed. The connection URL ?application_name= param can't be parsed. May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant