Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

psql terminal fails to launch

未关闭
#310 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
postgresql

调研方向

Start by reproducing on Windows with psql on PATH: run the context-menu action "pgsql.psqlTerminalDatabase" and the command "PGSQL: Connect with PSQL" with a connection open, and compare the two errors ("reading '1'" and "reading 'connectionInfo'"). The payload names no source files, so locate the psql terminal command in the extension and find where it reads the connection and the active database. Read the four existing comments for any diagnosis first. Done means the terminal opens connected to the selected database on Windows, with the reproduction steps confirmed.

由索引模型根据 Issue 内容生成。

描述

bug

Describe the bug

When launching a psql terminal from the context menu in the Postgresql database explorer panel, the terminal fails to launch with the following error message.

Error running command pgsql.psqlTerminalDatabase: Cannot read properties of null (reading '1'). This is likely caused by the extension that contributes pgsql.psqlTerminalDatabase.

When launching the terminal from the command pallette "PGSQL: Connect with PSQL" with an open database active the error message is slightly different:

Command 'PGSQL: Connect with PSQL' resulted in an error: Cannot read properties of undefined (reading 'connectionInfo')

psql exetubale is included in my windows path and is found with where psql.

$ where psql
C:\Users\<user>\AppData\Local\Programs\pgAdmin 4\runtime\psql.exe
C:\Program Files\QGIS 3.40.14\bin\psql.exe

It happens on all my postgresql connections, so also on for example:

       {
            "id": "6C6AC2B3-AA2E-4EE3-9E34-AA44EB883807",
            "groupId": "E9E9C702-BC45-4E78-A04C-9CF782103D09",
            "authenticationType": "SqlLogin",
            "connectTimeout": 15,
            "applicationName": "vscode-pgsql",
            "clientEncoding": "utf8",
            "sslmode": "prefer",
            "sshSavePassword": true,
            "savePassword": true,
            "sslRootCertMode": "none",
            "server": "localhost",
            "user": "postgres",
            "password": "",
            "database": "bce_models",
            "profileName": "bce-postgres-local",
            "expiresOn": 0,
            "sshPassword": "",
            "profileSource": 0,
            "displayName": "bce-postgres-local"
        }

To Reproduce

See the description of the bug.

Expected behavior

psql terminal is launched connected to the selected Postgresql database.

VS Code version

Version: 1.141.0 (user setup)
Commit: 2a59476c9bfcb90b3ddc372c36762471b7dfad1c
Date: 2026-10-06T10:15:52+02:00
Electron: 43.7.7
ElectronBuildId: 15553055
Chromium: 150.0.7871.250
Node.js: 24.21.0
V8: 15.0.245.31-electron.0
@github/copilot: 1.0.92-4.unstable.r37397886721.gad270aa
@github/copilot-sdk: 1.0.17.37397886721.gad270aa
OS: Windows_NT x64 10.0.26200

Extension Version and Logs

Extension version ms-ossdata.vscode-pgsql 1.32.0

Relevant Extension output

...

<img width="411" height="175" alt="Image" src="https://github.com/user-attachments/assets/8d44219f-49b0-44f7-a891-a51b818558f6" />

[11:58:01 AM] Connected to server "localhost" on document "6C6AC2B3-AA2E-4EE3-9E34-AA44EB883807". Server information: {"isCloud":false,"server":"PostgreSQL","serverVersion":"15.13"}
[11:59:05 AM] [PgToolsService Initialization] [Information]: Target is pg version 15.13

Add any other context about the problem here.

Windows 11 platform

主要语言
没有语言数据
星标
399
派生
33
平均合并
1 天 9 小时
30 天内合并 PR
2

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-pgsql 的其他 Issue

查看 microsoft/vscode-pgsql 的全部 Issue

相似的 Issue

更多 Databases Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。