PostgreSQL extension for VS Code: explore, query and troubleshoot
Microsoft's PostgreSQL extension brings connecting, browsing schemas, writing and running SQL, and asking GitHub Copilot about the connected database into VS Code. The post walks through four workflows, from exploring a first table to reviewing a performance recommendation. It is a practical guide for .NET developers who work against PostgreSQL and want to stay in their editor.
Key points
- Save a connection profile from the PostgreSQL icon in the Activity Bar to reuse it later
- For Azure databases, sign in with Microsoft Entra ID and pick the subscription, server and database
- Use IntelliSense for table, column and join suggestions, and review generated SQL before running it
- Ask Copilot to analyze a query using its execution plan and execution metrics
- Verify Copilot's schema answers in Object Explorer and the schema visualizer with small read-only queries
- Before applying a Database Agent recommendation, define the expected outcome, the metrics to check and the rollback step
Microsoft's PostgreSQL extension for VS Code covers much of the everyday database work that usually pulls developers out of their editor. You can connect to on-premises or Azure servers, browse schemas, write and run SQL, and ask GitHub Copilot about the database you are connected to. The Microsoft for Developers blog post shows these features through four workflows, from exploring a first table to reviewing a performance recommendation.
The most useful part is the verification habit it encourages. Copilot's answers about table relationships or query plans should be checked against the database with small read-only queries. Index suggestions from Database Agent deserve the same care: review the supporting metrics and a rollback plan before applying anything. The post also describes Database Agent as an upcoming experience with manual actions, so confirm current availability and Azure requirements first.
Real-world use
- Finding which tables hold the data for an inherited ASP.NET Core feature before changing code
- Writing a quarterly revenue query over customer and payment tables and checking its execution plan
- Evaluating a composite index suggestion for repeated lookups on a large transactions table
Why it matters
Schema discovery and query work can now stay inside VS Code, which reduces context switching between code and data. Copilot's answers and performance suggestions still need checking against the real database before you change anything.