Before You Start

Your instructor will give you a connection card with these values. Keep it nearby, but do not paste the card into a public document, GitHub repository, or help request.

Server nameprovided-by-instructor.postgres.database.azure.com
Port5432
Database nameprovided by instructor
User nameyour assigned login
Passwordyour assigned password
SSL modeRequire

1 Install Visual Studio Code

  1. Go to the official VS Code download page.
  2. Download the Stable release for your operating system. Do not use the Insiders build for this course.
  3. Install it:
    • Windows: run the User Setup .exe and accept the defaults.
    • macOS: open the .dmg and drag Visual Studio Code into Applications.
    • Linux: use the .deb or .rpm package appropriate for your distribution.
  4. Open Visual Studio Code.

The full operating-system-specific instructions are in the official VS Code setup guide.

2 Install Microsoft's PostgreSQL Extension

  1. Open the Extensions view from the left Activity Bar, or press Ctrl+Shift+X on Windows/Linux or Cmd+Shift+X on macOS.
  2. Search for PostgreSQL.
  3. Select PostgreSQL published by Microsoft, then choose Install.
Check the extension ID ms-ossdata.vscode-pgsql
Open the official extension

After installation, a PostgreSQL elephant icon appears in the Activity Bar. Select it to open the PostgreSQL view.

3 Connect to the Course Server

  1. Open the PostgreSQL view. Under Connections, select Add New Connection (the + icon).
  2. Leave Connect via set to Parameters.
  3. Enter the values from your course connection card.
VS Code fieldWhat to enter
Server nameThe full Azure host name from your instructor. Do not include https://.
Authentication TypePassword, unless your instructor explicitly says to use Entra Auth.
User nameYour assigned PostgreSQL login.
PasswordYour assigned PostgreSQL password.
Database nameThe assigned course database, not a name you invent.
Connection NameMaDS SQL · Fall 2026 or another clear label.
  1. Select Advanced. Confirm the port is 5432, then open the SSL section and set SSL mode to Require.
  2. On your own computer, you may select Save Password. Do not save it on a shared or lab computer.
  3. Select Test Connection. When the test succeeds, select Save & Connect.

A successful connection appears in the Connections tree with a green status indicator.

4 Run a Verification Query

  1. Right-click your connected server and select New Query.
  2. Confirm that the database dropdown in the query editor shows the database your instructor assigned.
  3. Paste and run this query:
SQL
SELECT
  current_database() AS database_name,
  current_user       AS signed_in_as,
  version()          AS server_version;

Run the current statement with Ctrl+Shift+E on Windows/Linux or Cmd+Shift+E on macOS. You should see one result row with your database, login, and PostgreSQL version.

Optional: see the course tables

SQL
SELECT table_schema, table_name
FROM information_schema.tables
WHERE table_schema NOT IN ('pg_catalog', 'information_schema')
ORDER BY table_schema, table_name;

If the instructor has already loaded course data, this lists the tables you can query. An empty result does not mean the connection failed; it may mean the tables have not been loaded yet.

You are ready for class when:
  • VS Code opens normally.
  • The PostgreSQL elephant appears in the Activity Bar.
  • Your course connection has a green status indicator.
  • The verification query returns one row.

Troubleshooting

What you seeMost likely causeWhat to do
“Could not translate host name” or “Name or service not known”The server name was mistyped.Copy the full host name again. Do not add spaces or https://.
The connection times outYour current IP address is not allowed by the Azure firewall, or the server is stopped.Send your instructor your current public IP using the class-approved process. Do not post credentials.
“Password authentication failed”The user name or password is wrong.Retype both values. Watch for a copied trailing space. Ask the instructor to reset the password if needed.
An SSL or TLS errorThe connection is not requiring encryption.Edit the connection, open Advanced → SSL, and choose Require.
The query runs against the wrong databaseThe query editor is using another database context.Choose the assigned database from the query editor's database dropdown.
No PostgreSQL elephant iconThe extension is missing, disabled, or not the Microsoft extension.Open Extensions and verify ID ms-ossdata.vscode-pgsql. Reload VS Code if prompted.

Official Guides