Skip to content

Support quoted parameters and URI syntax in PostgreSQL connection strings#5346

Merged
matejk merged 1 commit into
pocoproject:mainfrom
db4:postgresql
May 13, 2026
Merged

Support quoted parameters and URI syntax in PostgreSQL connection strings#5346
matejk merged 1 commit into
pocoproject:mainfrom
db4:postgresql

Conversation

@db4

@db4 db4 commented May 7, 2026

Copy link
Copy Markdown
Contributor

Currently POCO parses PostgreSQL connection strings itself and doesn't support quoted parameters with spaces as described in https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-CONNSTRING

This PR uses libpq to parse connection strings and also supports URI syntax.

@matejk matejk added this to the Release 1.15.3 milestone May 11, 2026

@matejk matejk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review combining clang-tidy 21 (focused on PR-changed lines), an independent code-reviewer agent, CodeRabbit CLI 0.4.5, and empirical libpq probing.

One critical finding (silent corruption of postgres:// URI connection strings -- see inline on SessionImpl.cpp L110), one important test-coverage gap, and several minor style/correctness suggestions inline.

Thanks for taking this on -- moving from the home-grown parser to libpq is the right call, and URI support is a welcome addition.

Comment thread Data/PostgreSQL/src/SessionImpl.cpp
Comment thread Data/PostgreSQL/src/SessionImpl.cpp Outdated
Comment thread Data/PostgreSQL/src/SessionImpl.cpp Outdated
Comment thread Data/PostgreSQL/src/SessionImpl.cpp Outdated
Comment thread Data/PostgreSQL/src/SessionImpl.cpp Outdated
Comment thread Data/PostgreSQL/src/SessionImpl.cpp Outdated
Comment thread Data/PostgreSQL/testsuite/src/PostgreSQLTest.cpp
@db4

db4 commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

@matejk I've implemented the changes based on your review comments

@matejk matejk merged commit 47b8c67 into pocoproject:main May 13, 2026
44 checks passed
@db4 db4 deleted the postgresql branch May 13, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants