rust-postgres: Error querying PgBouncer
PgBouncer seems to implement some, but not all, of the postgres protocol. Specifically, I was running into this error when trying to query it:
Db(DbError {
severity: "ERROR",
parsed_severity: None,
code: ProtocolViolation,
message: "unsupported pkt type: 80",
detail: None,
hint: None,
position: None,
where_: None,
schema: None,
table: None,
column: None,
datatype: None,
constraint: None,
file: None,
line: None,
routine: None
})
The error message is from PgBouncer internals (admin.c:1365). Basically, looks like the 'P' frame isn’t handled. This is generated from postgres_protocol::messages::frontend::parse.
Any suggestions on how to resolve?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 16 (12 by maintainers)
I have also encountered this issue, and have revised my code to use
simple_querywhen used with pgbouncer. However, I notice that the documentation forsimple_querystates that itI’m a bit confused about how this interacts with the advice in this issue to use
simple_queryfor all queries involving pgbouncer (since that will inevitably mean usingsimple_querywith at least some user-provided data). Based on #575, it appears that rust-postgres does not currently provide a method for escaping user input when usingsimple_query; is that correct?If so, what is the correct way to use pgbouncer for all Postgres queries (which, of course, includes queries with user-provided parameters)?
Thanks very much for any help and for rust-postgres as a whole!