jackc / jackc/pgx

ERROR: prepared statement "stmtcache_XXX" does not exist (SQLSTATE 26000)

Open
#1,590 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
14.3k
Forks
1.1k
Avg merge
6d 9h
Merged PRs (30d)
11

Description

**Describe the bug**
I am connecting via pgbouncer.
in v4 I did it using arguments: ```prefer_simple_protocol=1&client_encoding=UTF8```
in version 5 i used ```default_query_exec_mode=simple_protocol&client_encoding=UTF8```

but it didn't work :(

I am using the default driver

i debugged. the config from the parameters was parsed correctly.

**Version**
- Go: `$ go version` -> [e.g. go version go1.20.4 linux/amd64]
- PostgreSQL: `$ psql --no-psqlrc --tuples-only -c 'select version()'` -> [e.g. PostgreSQL 15.2 (Ubuntu 15.2-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit]
- pgx: `$ grep 'github.com/jackc/pgx/v[0-9]' go.mod` -> [e.g. v5.3.1]

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the connection through pgbouncer using the reported default_query_exec_mode=simple_protocol and client_encoding=UTF8 parameters. Confirm the Go, PostgreSQL, and pgx versions, then compare behavior with and without pgbouncer. Done means the prepared statement error is reproduced, its trigger is identified, and a verified resolution is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.