PostgreSQL for Visual Studio Code
Welcome to PostgreSQL for Visual Studio Code! An extension for developing PostgreSQL with functionalities including:
- Connect to PostgreSQL instances
- Manage connection profiles
- Connect to a different Postgres instance or database in each tab
- View object DDL with 'Go to Definition' and 'Peek Definition'
- Write queries with IntelliSense
- Run queries and save results as JSON, csv, or Excel
Open the Command Palette (Ctrl + Shift + P).
Search and select 'PostgreSQL: New Query'
In the command palette, select 'Create Connection Profile'. Follow the prompts to enter your Postgres instance's hostname, database, username, and password.
You are now connected to your Postgres database. You can confirm this via the Status Bar (the ribbon at the bottom of the VS Code window). It will show your connected hostname, database, and user.
You can type a query like 'SELECT * FROM pg_stat_activity';
Right-click, select 'Execute Query' and the results will show in a new window.
You can save the query results to JSON, csv or Excel.
The extension will download and install a required PostgreSQL Tools Service package during activation. For machines with no Internet access, you can still use the extension by choosing the
Install from VSIX... option in the Extension view and installing a bundled release from our Releases page.
Each operating system has a .vsix file with the required service included. Pick the file for your OS, download and install to get started.
We recommend you choose a full release and ignore any alpha or beta releases as these are our daily builds used in testing.
Contributing to the Extension
See the developer documentation for details on how to contribute to this extension.
Code of Conduct
The Microsoft Enterprise and Developer Privacy Statement describes the privacy statement of this software.