Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle prepared statement in collisions #2448

Open
heavycrystal opened this issue Jan 15, 2025 · 0 comments
Open

handle prepared statement in collisions #2448

heavycrystal opened this issue Jan 15, 2025 · 0 comments

Comments

@heavycrystal
Copy link
Contributor

As per jackc/pgx#1847, pgx keeps track of prepared statements it creates and expects the connection to be in sync with the cache (because prepared statements are not global, they're per backend). Some poolers like PgBouncer and Supavisor are breaking this assumption and causing multiple executions of the same SQL statement to fail like:

failed to fetch custom type mapping: failed to get customTypeMapping: ERROR: prepared statement "stmtcache_7d186420d84f94f4834117286faada6342a9373d2d7ff41d" already exists

We need to disable automatic prepared statement creation in these cases, or error out gracefully pointing out this is due to poolers

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

No branches or pull requests

1 participant