Bug description
We're encountering a repeated failure in SQL Lab when trying to save tab state. The backend logs reveal that database_id is being sent as a string ("postgresql-examples-1") instead of the expected integer ID, which results in an insert failure.
Connect to Superset using Docker (latest stable or master version).
Add a PostgreSQL database with name or UUID like postgresql-examples-1.
Go to SQL Lab → SQL Editor.
Create a new tab and attempt to write a simple query.
Observe the failure when Superset tries to persist the tab state.
ERROR: invalid input syntax for type integer: "postgresql-examples-1" STATEMENT: INSERT INTO tab_state (...) VALUES (..., 'postgresql-examples-1', ...)
🛠️ Environment Info:
Superset version: latest (or specify e.g., 3.0.1)
Deployment: Docker (docker-compose-non-dev.yml)
Database Backend: PostgreSQL 16
Browser: Chrome 137
OS: Linux (multiple OS tested)
Reproducible: Yes (across multiple machines and OS setups)
📎 Additional Context:
The issue seems related to SQL Lab's tab state API (POST /tabstateview/).
Appears to break compatibility in environments with example DBs or custom database names.
🙏 Request:
Please validate whether the frontend is passing the correct database_id, and consider adding input validation or type coercion on the backend to avoid this type mismatch.
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
Bug description
We're encountering a repeated failure in SQL Lab when trying to save tab state. The backend logs reveal that database_id is being sent as a string ("postgresql-examples-1") instead of the expected integer ID, which results in an insert failure.
Connect to Superset using Docker (latest stable or master version).
Add a PostgreSQL database with name or UUID like postgresql-examples-1.
Go to SQL Lab → SQL Editor.
Create a new tab and attempt to write a simple query.
Observe the failure when Superset tries to persist the tab state.
ERROR: invalid input syntax for type integer: "postgresql-examples-1" STATEMENT: INSERT INTO tab_state (...) VALUES (..., 'postgresql-examples-1', ...)🛠️ Environment Info:
Superset version: latest (or specify e.g., 3.0.1)
Deployment: Docker (docker-compose-non-dev.yml)
Database Backend: PostgreSQL 16
Browser: Chrome 137
OS: Linux (multiple OS tested)
Reproducible: Yes (across multiple machines and OS setups)
📎 Additional Context:
The issue seems related to SQL Lab's tab state API (POST /tabstateview/).
Appears to break compatibility in environments with example DBs or custom database names.
🙏 Request:
Please validate whether the frontend is passing the correct database_id, and consider adding input validation or type coercion on the backend to avoid this type mismatch.
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist