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
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:
SELECT1;
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)
Thanks bakinngTray -- I was able to reproduce this. We'll ship a fix in the next release. Do note that the feature is session-only at the moment; previous queryies before a restart aren't persisted. Besides the actual error shown in your report, are you looking for that feature request as well?
Yes, persistent query history across VS Code restarts would be very useful as well. I expected previously executed queries to remain available after reloading the window or restarting VS Code.
Activity
mmcfarland commentedon Sep 9, 2026
Thanks bakinngTray -- I was able to reproduce this. We'll ship a fix in the next release. Do note that the feature is session-only at the moment; previous queryies before a restart aren't persisted. Besides the actual error shown in your report, are you looking for that feature request as well?
bakinngTray commentedon Sep 10, 2026
Hi Matt McFarland (@mmcfarland), thank you for the quick response and for reproducing the issue.
Yes, persistent query history across VS Code restarts would be very useful as well. I expected previously executed queries to remain available after reloading the window or restarting VS Code.