Describe the bug
The PostgreSQL extension successfully connects to the database, displays the
Object Explorer, executes SQL queries, and shows query results. However, the
Query History command fails after VS Code is reloaded if at least one query was
executed before the reload.
To Reproduce
Steps to reproduce the behavior:
-
Connect to any PostgreSQL database.
-
Run a query, for example:
-
Run Developer: Reload Window.
-
Run PGSQL: Open Query History in Command Palette.
Actual result
VS Code displays the following error:
Command 'PGSQL: Open Query History in Command Palette' resulted in an error
Cannot read properties of undefined (reading 'length')
The Query History view cannot be opened. Clearing the history removes existing
entries, but the same error returns after executing another query and reloading
VS Code.
Expected behavior
Query History should open successfully and display queries executed before the
VS Code reload.
VS Code version
- Extension:
ms-ossdata.vscode-pgsql 1.30.1
- VS Code: 1.136.2
- Operating system: Windows
- Database: PostgreSQL, connected through PgBouncer
Extension Logs
2026-09-09 16:18:31.101 [error] TypeError: Cannot read properties of undefined (reading 'length')
at limitStringSize (C:\\Users\\<username>\\.vscode\\extensions\\ms-ossdata.vscode-pgsql-1.30.1-win32-x64\\dist\\extension.js:72:24815)
at QueryHistoryUI.convertToQuickPickItem (C:\\Users\\<username>\\.vscode\\extensions\\ms-ossdata.vscode-pgsql-1.30.1-win32-x64\\dist\\extension.js:330:3142)
at Array.map (<anonymous>)
at QueryHistoryProvider.showQueryHistoryCommandPalette (C:\\Users\\<username>\\.vscode\\extensions\\ms-ossdata.vscode-pgsql-1.30.1-win32-x64\\dist\\extension.js:330:5423)
Describe the bug
The PostgreSQL extension successfully connects to the database, displays the
Object Explorer, executes SQL queries, and shows query results. However, the
Query History command fails after VS Code is reloaded if at least one query was
executed before the reload.
To Reproduce
Steps to reproduce the behavior:
Connect to any PostgreSQL database.
Run a query, for example:
Run
Developer: Reload Window.Run
PGSQL: Open Query History in Command Palette.Actual result
VS Code displays the following error:
The Query History view cannot be opened. Clearing the history removes existing
entries, but the same error returns after executing another query and reloading
VS Code.
Expected behavior
Query History should open successfully and display queries executed before the
VS Code reload.
VS Code version
ms-ossdata.vscode-pgsql1.30.1Extension Logs