Skip to content

Put the default application_name into URI connection strings instead of in front of them - #619

Merged
staticlibs merged 1 commit into
duckdb:mainfrom
PeterVanHolland:uri_application_name
Oct 15, 2026
Merged

staticlibs merged 1 commit into
duckdb:mainfrom
PeterVanHolland:uri_application_name

Conversation

@PeterVanHolland

Copy link
Copy Markdown
Contributor

Since #617, ATTACH 'postgresql:///mydb' AS pg (TYPE postgres) fails with a missing "=" error. This affects both postgresql:// and postgres:// URIs without application_name, including DuckLake catalogs using these paths.

The default name is prepended as application_name=DuckDB . libpq only recognizes a URI when the connection string starts with a URI prefix. It therefore reads the result as key/value pairs and rejects the URI.

This change appends the default name as a URI parameter, using the same helper as the secret's URI option. It handles empty queries, trailing separators and ? in passwords or parameter values. Tests check the default and supplied names in pg_stat_activity, with connection errors treated as failures instead of skips. They fail before the change and pass after it. The password case was checked manually over a local socket, and the other tests pass locally against Postgres.

Related: pdet/ducklake_internal#200

@staticlibs
staticlibs marked this pull request as ready for review October 15, 2026 06:37
@staticlibs
staticlibs merged commit ed73241 into duckdb:main Oct 15, 2026
7 checks passed
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

Successfully merging this pull request may close these issues.

2 participants