Skip to content

WIP: Replace prepare statements with plain queries#802

Draft
caius wants to merge 2 commits intopganalyze:mainfrom
caius:v0.70.0-plainqueries
Draft

WIP: Replace prepare statements with plain queries#802
caius wants to merge 2 commits intopganalyze:mainfrom
caius:v0.70.0-plainqueries

Conversation

@caius
Copy link
Copy Markdown

@caius caius commented Apr 9, 2026

We're forced to run through a transaction based connection pool, which doesn't support prepared statements due to connections being swapped out between the collector and the database server.

Replace all the explicit prepare/query calls with plain query calls instead.

Not expecting this to be accepted upstream, but its the version we're running internally that's working for us.

@caius caius changed the title Replace prepare statements with plain queries WIP: Replace prepare statements with plain queries Apr 9, 2026
@lfittl
Copy link
Copy Markdown
Member

lfittl commented Apr 9, 2026

We're forced to run through a transaction based connection pool, which doesn't support prepared statements due to connections being swapped out between the collector and the database server.

Replace all the explicit prepare/query calls with plain query calls instead.

Not expecting this to be accepted upstream, but its the version we're running internally that's working for us.

Thanks for sharing!

Clearly my assumptions in #793 were incorrect, since we explicitly call the functions that produce prepared statements.

We'll discuss internally how to go about this to address it one way or the other. For context, we do generally discourage running a connection pooler between the pganalyze collector and the database, but understand that in certain deployments this is hard to avoid.

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.

3 participants