Skip to content

Result grid does not move messages tab when commit/rollback button is clicked with server cursor on. #8991

Done

Description

@pravesh-sharma

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

Screenshots

467490921-4a953057-4a5d-4281-bc0d-b3fc105f36f0.mov

If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Macos Sequoia
  • Version: 9.6
  • Mode: Desktop

Activity

  1. dpage commented on Aug 19, 2026

    @dpage
    Contributor

    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.

  2. dpage commented on Oct 12, 2026

    @dpage
    Contributor

    Fixed in 4682025 (#10321).

  3. VIBVEL47 commented on Oct 28, 2026

    @VIBVEL47
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions