microsoft / microsoft/vscode-pgsql

Support port in ServerName for connection strings

Open
#119 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
No language data
Stars
395
Forks
33
Avg merge
1h 46m
Merged PRs (30d)
3

Description

Describe the bug

I have multiple postgresql version which uses different ports.
Upon checking, ports are not recognized in the Server Name
It can only be set via advanced settings but it isn't set when connecting via connection string.

Ports are not supported when using "hostname:port" format

To Reproduce

  1. Set server name to "localhost:5432" (Specify default port)
  2. Test Connection
  3. Set server name to "localhost:5433" (Specify custom port for a different postgresql version)
  4. Test Connection

Expected behavior
It should connect successfully since 5432 is the default port and also 5433 for the custom port

Actual behavior
Both: Connection error: [Errno 11001] getaddrinfo failed

VS Code version

Version: 1.102.1 (user setup)
Commit: 7adae6a56e34cb64d08899664b814cf620465925
Date: 2025-07-15T16:41:17.147Z
Electron: 35.6.0
ElectronBuildId: 11847422
Chromium: 134.0.6998.205
Node.js: 22.15.1
V8: 13.4.114.21-electron.0
OS: Windows_NT x64 10.0.19045

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files or tests. Start by tracing how connection strings are parsed and how PostgreSQL connection settings are passed to the client; verify that both localhost:5432 and localhost:5433 use the parsed host and port, then reproduce the two connection attempts from the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.