Skip to content

fix(postgres): use non-prepared statements for metadata queries#4226

Open
abonander wants to merge 9 commits intomainfrom
ab/pg-resolve-raw
Open

fix(postgres): use non-prepared statements for metadata queries#4226
abonander wants to merge 9 commits intomainfrom
ab/pg-resolve-raw

Conversation

@abonander
Copy link
Copy Markdown
Collaborator

@abonander abonander commented Apr 10, 2026

Does your PR solve an issue?

Avoids the use of prepared statements to fetch type metadata to improve compatibility with third-party databases that don't support named prepared statements.

Additionally, metadata queries are batched as much as possible, to reduce round-trips to the server. This should reduce query preparation overhead as well as overhead in the query macros.

This also batches the queries used to populate ColumnOrigin data for the macros (it may be a good idea to batch this further with the attnotnull query used to seed the nullability analysis).

closes #4062 (superceded PR)

Is this a breaking change?

Should not be. Any changes in type resolution should be considered a regression.

@abonander abonander changed the title WIP fix(postgres): use non-prepared statements for metadata queries fix(postgres): use non-prepared statements for metadata queries Apr 24, 2026
@abonander
Copy link
Copy Markdown
Collaborator Author

@v0idpwn do you mind trying this branch and see if it addresses the issue in your PR #4062? This is the approach I had in mind in #4062 (comment)

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.

1 participant