You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Result grid does not move messages tab when commit/rollback button is clicked with server cursor on. #8991
Describe the bug
If we click on commit or rollback button with server cursor, empty result grid is shown it should move to the messages tab same as on the case of normal execution
Dug into this, and the actual bug goes a fair bit deeper than the UI symptom.
With "server cursor" mode on, the Commit/Rollback buttons run BEGIN;/COMMIT;/ROLLBACK; through execute_void(), which reuses whatever cursor is cached on the connection — and once any query has run, that's the named/server-side cursor psycopg created for it. A named cursor's execute() always wraps the statement as DECLARE ... CURSOR FOR <query>, which can't express a transaction-control statement (DECLARE ... CURSOR FOR COMMIT is a syntax error), and on top of that pgAdmin's own cursor wrapper always forwards a prepare= keyword the server-side cursor's execute() doesn't accept at all, so it actually failed one step earlier with TypeError: keyword not supported: prepare.
That exception was swallowed by a blanket except Exception in the background query thread, so the COMMIT/ROLLBACK never reached the database at all. The empty result grid this issue describes is the visible fallout: the next /poll call picked up the previous query's leftover column info rather than switching to the Messages tab.
In other words, with server cursor mode enabled, clicking Commit or Rollback didn't actually commit or roll back anything — the transaction was left open with no error shown to the user, which is a correctness issue, not just a cosmetic one.
Fixed by routing BEGIN/COMMIT/ROLLBACK through a throwaway plain cursor instead of the cached server-side one when server cursor mode is active, and clearing the stale column info so the app correctly reports no result set afterwards.
Reopening: still reproduces after #10321. With server cursor on, Commit/Rollback still leave the previous query's columns in the grid instead of switching to Messages; the commit/rollback itself works.
Activity
dpage commentedon Aug 19, 2026
Dug into this, and the actual bug goes a fair bit deeper than the UI symptom.
With "server cursor" mode on, the Commit/Rollback buttons run
BEGIN;/COMMIT;/ROLLBACK;throughexecute_void(), which reuses whatever cursor is cached on the connection — and once any query has run, that's the named/server-side cursor psycopg created for it. A named cursor'sexecute()always wraps the statement asDECLARE ... CURSOR FOR <query>, which can't express a transaction-control statement (DECLARE ... CURSOR FOR COMMITis a syntax error), and on top of that pgAdmin's own cursor wrapper always forwards aprepare=keyword the server-side cursor'sexecute()doesn't accept at all, so it actually failed one step earlier withTypeError: keyword not supported: prepare.That exception was swallowed by a blanket
except Exceptionin the background query thread, so the COMMIT/ROLLBACK never reached the database at all. The empty result grid this issue describes is the visible fallout: the next/pollcall picked up the previous query's leftover column info rather than switching to the Messages tab.In other words, with server cursor mode enabled, clicking Commit or Rollback didn't actually commit or roll back anything — the transaction was left open with no error shown to the user, which is a correctness issue, not just a cosmetic one.
Fixed by routing BEGIN/COMMIT/ROLLBACK through a throwaway plain cursor instead of the cached server-side one when server cursor mode is active, and clearing the stale column info so the app correctly reports no result set afterwards.
fix: run BEGIN/COMMIT/ROLLBACK on a plain cursor under server cursor …
fix: run BEGIN/COMMIT/ROLLBACK on a plain cursor under server cursor …
fix: run BEGIN/COMMIT/ROLLBACK on a plain cursor under server cursor …
fix: run BEGIN/COMMIT/ROLLBACK on a plain cursor under server cursor …
Fix BEGIN, COMMIT and ROLLBACK silently failing in the Query Tool und…
dpage commentedon Oct 12, 2026
Fixed in 4682025 (#10321).
VIBVEL47 commentedon Oct 28, 2026
Reopening: still reproduces after #10321. With server cursor on, Commit/Rollback still leave the previous query's columns in the grid instead of switching to Messages; the commit/rollback itself works.
Also replace the cursor an earlier COMMIT or ROLLBACK installed, so a…
Fixed an issue where the Query Tool showed the previous result grid i…