-
Notifications
You must be signed in to change notification settings - Fork 137
Description
Hi there,
We use PgBouncer as our connection pooler in transaction mode, which means we cannot use prepared statements. In our application, we disable prepared statements by using QueryExecModeSimpleProtocol. I believe this is a common setup given the limitation of transaction mode.
The problem is running the River client produces:
level=ERROR
msg="producer: Error fetching initial queue settings"
err="ERROR: invalid input syntax for type json (SQLSTATE 22P02)"
Which I believe is likely related to river_queue.metadata database column which is JSONB. According to pgx's comment on QueryExecModeSimpleProtocol:
This is especially significant for []byte values. []byte values are encoded as PostgreSQL bytea. string must be used
instead for text type values including json and jsonb.
This means I'm pretty sure the following line is the issue:
Line 292 in 6b9b622
| Metadata: []byte("{}"), |
I appreciate this isn't a direct problem with River, though I think River's pgx driver would ideally know which exec mode is being used and use the according types?
Any advice would be much appreciated! Thank you.