Skip to content

Evict cached statements on schema change for tables with 10+ columns - #1754

Merged
tsegismont merged 1 commit into
eclipse-vertx:4.xfrom
tsegismont:backport-1752-4x
Oct 15, 2026
Merged

tsegismont merged 1 commit into
eclipse-vertx:4.xfrom
tsegismont:backport-1752-4x

Conversation

@tsegismont

Copy link
Copy Markdown
Member

Backport #1752

…clipse-vertx#1752)

See eclipse-vertx#1751

Motivation:

TABLE_SCHEMA_CHANGE_ERROR_MESSAGE_PATTERN matched the column counts with
\d, a single digit, and String.matches requires a full match. So
"bind message has 10 result formats but query has 11 columns" never
matched, the stale cached statement was never evicted, and every later
execution on the connection failed with the same error until the
connection was closed.

Postgres reports this error when a proxy such as RDS Proxy parses the
named statement again after the schema change, before the client binds.

Modifications:

Match the column counts with \d+ and precompile the pattern.

Add a test that uses a 10-column table, adds an 11th column, and
re-prepares the named statement with DEALLOCATE / PREPARE to simulate
the proxy.

Result:

The cached statement is evicted after the first failure, and the next
execution succeeds.

Assisted-by: Anthropic Claude (claude-opus-5-5)

Signed-off-by: Meemaw <ematej.snuderl@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@tsegismont tsegismont added this to the 4.5.36 milestone Oct 15, 2026
@tsegismont
tsegismont merged commit 752b0fa into eclipse-vertx:4.x Oct 15, 2026
18 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