Skip to content

merge: #2142 PG-wire Parse/Bind migrate onto the shared Prepared Registry - #2223

Merged
filipeforattini merged 6 commits into
mainfrom
afk/2142-pg-wire-parse-bind-migrate-onto-the-shar
Sep 9, 2026
Merged

filipeforattini merged 6 commits into
mainfrom
afk/2142-pg-wire-parse-bind-migrate-onto-the-shar

Conversation

@filipeforattini

@filipeforattini filipeforattini commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Automated AFK landing for #2142. Per-attempt history lives in the issue Envelopes, the local ledgers, and pushed worker-branch commits.

Closes #2142


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@filipeforattini

Copy link
Copy Markdown
Contributor Author

Blocking: this breaks every JDBC client

The "PG-Wire Clients" gate is red, and it is a real wire-compatibility break, not infrastructure. pgjdbc dies on its first statement:

org.postgresql.util.PSQLException: ERROR: query error: prepared-statement execution does not support create_table statements
	at JdbcClient.main(JdbcClient.java:17)

The message comes from the catch-all arm of the prepared dispatch in runtime/impl_core.rs:3054. That match handles Select, Insert, Update, Delete, SearchCommand and Ask; everything else is _ => Err(...).

The allowlist is not new — routing PG-wire through it is. It exists on main too, but before this PR the PG-wire extended-query path reached a dispatch that covered the full statement surface.

That distinction is what makes this severe: JDBC uses the extended query protocol for everything by default. PgStatement.execute goes through Parse/Bind/Execute even for DDL, so after this PR a stock JDBC client cannot issue CREATE TABLE at all. Any psycopg or pgx code path using the extended protocol is affected the same way. This is the most common Postgres client in the ecosystem failing on its first statement.

A rework is in flight. The direction given: prefer widening the prepared dispatch to delegate to the same dispatch the simple-query path already uses, rather than growing a second parallel match that can drift from it — a second allowlist is precisely the divergence Spec #2109 has been consolidating away. Falling back to the text path inside the PG-wire adapter is acceptable only if some statement class is genuinely unsafe to prepare-and-bind, and then that class and the reason need naming.

Also required: a regression test that drives DDL through the extended protocol (Parse/Bind/Execute), not the simple path. The existing coverage did not catch this because it exercised the simple path, which is why a break this broad reached CI.

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.

PG-wire Parse/Bind migrate onto the shared Prepared Registry

1 participant