My question is similar to: how to spy on a transaction that is not yet committed in postgres for debugging
What I tried:
- I start a pgbouncer instance, and set the max-db-connection to 1
- From my node application, i connect to pg-bouncer
BEGINa transaction, and inserted a few rows, i.e:
INSERT INTO USERS VALUES ('john')
- I end the application without
- I connect to pgbouncer from another client (i.e: Datagrip)
Expected: I can continue from the uncommitted transaction, and
SELECT * FROM USERS WHERE name = 'john', would retrieve the rows.
But what happens is that PgBouncer would close the connection (
closing because: unclean server (age=0s)) when a client connects, since it knows that there is an uncommited transaction. Is there a way to make this hack work with/without using PgBouncer?