Skip to content

Query Tool does not display SQL errors and /sqleditor/poll returns 500 #9872

@LordSnooz

Description

@LordSnooz

Describe the bug

In pgAdmin 9.13 Query Tool, SQL syntax errors are logged correctly by the pgAdmin backend, but they are not displayed in the UI. The frontend polling request returns HTTP 500, and the Messages tab remains empty.

To Reproduce

Steps to reproduce the behavior:

  1. Open pgAdmin 9.13
  2. Open the Query Tool for a PostgreSQL database.
  3. Execute an invalid SQL query with a trailing comma before FROM:
select id,
"name",
"dateTime",

from abc."tableName"
limit 100
  1. The query execution fails server-side.
  2. The browser console shows a 500 error on /sqleditor/poll/<query_tool_id>.
  3. No SQL error is displayed in the pgAdmin UI / Messages tab.

Expected behavior

pgAdmin should display the PostgreSQL syntax error in the Messages tab, for example:

ERROR: syntax error at or near "from"
LINE 6: from job."jobs"
        ^

SQL state: 42601
Character: 46

Error message

Browser console:
GET https://pgadmin.domainename.com/sqleditor/poll/733918 500 (Internal Server Error)

pgAdmin container logs:

10.210.0.5 - - [24/Apr/2026:11:39:03 +0000] "POST /sqleditor/query_tool/start/733918 HTTP/1.1" 200 138 "https://pgadmin.domainename.com/sqleditor/panel/733918?is_query_tool=true&sgid=17&sid=31&did=16406&database_name=db" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36"
2026-04-24 11:39:03,317: ERROR pgadmin: Failed to execute query (execute_async) for the server #31 - CONN:5390011(Query-id: 9793611):
Error Message:ERROR:  syntax error at or near "from"
LINE 6: from job."jobs"
        ^

SQL state: 42601
Character: 46

Screenshots

N/A

Desktop (please complete the following information):

  • OS: Docker on Ubuntu
  • pgAdmin version: 9.13
  • Mode: Server
  • Browser (if running in server mode): Chrome 147.0.0.0
  • Package type: Container

Additional context

The PostgreSQL error is correctly generated and logged by the pgAdmin backend, but the frontend does not receive or display it. Instead, the /sqleditor/poll/<query_tool_id> endpoint returns HTTP 500.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions