Skip to content(if available)orjump to list(if available)

Postgres IDE in VS Code

Postgres IDE in VS Code

166 comments

·May 23, 2025

seveibar

This solves a major problem that I built an npm package called "pgstrap"[1] for. It generates a "database structure" directory so that my database schema is available to LLMs (it also makes code review easier because you can see the changes to various tables). So I have a SQL file for each table in my database, neatly organized into directories for each schema. Rails has a similar idea with schema.rb

I'm not sure whether or not it's better to have your editor database-aware or to have your codebase have appropriate context committed. On one hand, less generated code/artifacts make for a cleaner codebase. On the other hand, not everyone uses VC Code or will know how to use this integration. Database browser GUIs have never really had a single winner. That said, VS Code does have enough dominance to potentially make themselves "the standard way to view a database in development"

[1] https://github.com/seveibar/pgstrap

netghost

That seems like a really pragmatic tool, thanks for sharing it!

I'm curious, do you output triggers, store procedures, and such? Many tools seem to stop after you've defined tables, columns, and indices, but I'd love some better tooling to make use of the rest of the DB's features.

seveibar

Yep! It basically runs pg_dump and categorizes all of the output into different files so it should be comprehensive. I think there's `functions/function_name.sql`, `misc.sql`, `triggers.sql` etc.

jsmith99

I just use a MCP server (with copilot or cline) that has a read only login to my database.

BoorishBears

Which is strictly worse than just giving the LLM access to the source of truth for the database.

You're adding a round trip to the database and the LLM and inserting a tool call in the conversation before it even starts generating any code.

And the reference Postgres MCP implementation doesn't include Postgres types or materialized views, and is one of the most widely used packages: Zed.dev's MCP server for example, is seemingly just a port of it and has the same problem.

todotask2

There seems to be a bug — I can't re-run the query from the query history panel; it returns no results.

New query could still get results.

Overall, it should have been a separate app because you can't really see all the results in a small panel.

qwertywert_

Isn't PGAdmin good enough? Not hating, but I'm not a database guy either so just curious why create a VSCode extension for GUI stuff.

lukebuehler

it's nice to have copilot in the db admin tool. I use pgadmin every day, and it's great, but lately i have found myself wishing to have AI support in writing certain queries.

pier25

Oh woah this looks great.

Quite amazing they put the effort into this for Postgres instead of SQL Server. The demand must be a lot higher.

shawnz

There is already a Microsoft SQL server extension for VS Code and this looks to effectively be a clone of it. After giving this a quick spin, it looks and feels the same as the SQL server extension, with the same menus, dialogs, etc. The SQL server extension I believe is what formed the basis of the now-deprecated Azure Data Studio (which was a VS code fork).

See here for the SQL server extension: https://marketplace.visualstudio.com/items?itemName=ms-mssql...

nevi-me

I speculate that it's because the MSSQL tools have been maintained as part of Azure Data Studio, and were in better shape.

ADS is being sunset, and I was surprised when trying to install the Postgres extension on VS Code to find that it had its last meaningful contribution 6 years ago [0]. It couldn't work on newer VS Code versions.

I use ADS with both Postgres and MSSQL, prior to this announcement, I kept using ADS because there was nothing to migrate to.

[0] https://github.com/microsoft/vscode-postgresql/commits/maste...

hobs

They built the postgres plugin in a way that nobody could usefully contribute to unless they worked at msft - like the rest of ADS the level of control they tried to maintain meant nobody wanted to work on it.

0cf8612b2e1e

That is seemingly true of a bunch of tools. I am using an official Microsoft Python library - the repo is public on GitHub, but all of the CI or other backend integration is behind the Microsoft curtain, so it is impossible for the public to actually participate. The cherry on top is that the team that used to support the tool was impacted, so now nobody can maintain the thing.

magicalhippo

They already have the SQL Server Management Studio[1], which seems to cover similar ground?

I'm assuming they might want to move SSMS to VSCode in time, so trying it out by covering new ground, PostgreSQL, makes sense to me.

[1]: https://learn.microsoft.com/en-us/ssms/sql-server-management...

pier25

But it's only for Windows

osigurdson

SQL server is in "cash cow mode" at this point. Investing more into tooling is unlikely to increase revenues at this stage.

90s_dev

Microsoft seems to be going all in on open source over the past 10-15 years.

From a consumer perspective, we're almost all benefiting.

From a business perspective, they get unpaid help and community brownie points.

teruakohatu

> going all in on open source over the past 10-15 years.

Given that there are many Microsoft closed source extensions for VS Code, that cannot legally be used with the open source Version of VS Code, I would say they are not going all in. Knee deep maybe.

ahartmetz

Because of the closed extensions situation, the open source part feels insincere. Sort of like a free plan up to 10 users and then pretty expensive situation. The purpose isn't the free plan, it's just an advertising measure to get people to where you really benefit eventually.

90s_dev

Also, given that they recently bought github, they have financial incentive to keep people there, who might upgrade to pro accounts or grow to need enterprise.

wg0

I wish there was something similar for SQLite.

Wojtkie

The copilot integrations look sweet, as does the schema view. The MSSQL extension doesn't have those, but the rest of it looks similar to the Postgres one.

null

[deleted]

qntmfred

will definitely be taking a look at this. i started my career on mostly SQL Server and using SSMS fits my brain like a glove. i've been so dissatisfied with the typical options (pgadmin, dbeaver, datagrip, etc) for managing/querying postgres since i started using it probably like 10 years ago. postgres itself is great (don't get it twisted either, SQL Server is fantastic. just costs money) but i never understood why there wasn't more uproar in the community about its DBMS tooling ecosystem

FeloniousHam

I've found Datagrip to be far and away the most impressive universal database tool. I feel like I've tried them all, and they all have a quality of having been developed by database people, rather than IDE designers. The depth of capability, extensibility, pace of improvement--I'm a very happy customer.

I don't want to poop on open source, but pgadmin and dbeaver and not even close to playing in the same league.

I work in Oracle and Datagrip saved my sanity.

Errsher

Are there any features in datagrip in particular that you like that aren't in dbeaver?

FajitaNachos

Postico has always been my defacto way to interact with Postgres. Curious if there are any Postico users who have tried this yet.

zamacho

Is there a similar extension for MySQL in VS Code?

jamesgeck0

Database Client is fairly similar. I don't think it does the schema diagrams or AI stuff, but it can do notebooks. Has a shareware pricing model, free for up to three active connections. https://database-client.com/

bdcravens

Looks nice enough. I only wish there was an easy way to spread VS Code across multiple monitors. I commonly will work in code on one monitor, and the database tool (DataGrip currently) on another.

jayflux

VS Code has had multi monitor support for a while now https://code.visualstudio.com/docs/configure/custom-layout#_...

Fire-Dragon-DoL

I noticed yesterday that you can pull out a tab into its own window. It's not "natural" cross monitor, but you can place the windows on both. Not sure if that helps

bartvk

Have you thought about just solving the problem with hardware? I.e. one giant 38" wide screen?

impalallama

Biggest thing that JetBrains has over VSCode for me was their very clean built in database tooling

bdcravens

You can also run the database tool separate (DataGrip). That's what I do.

Toritori12

I wonder what is the most "valuable" IDE right now for MS. A few years ago VsCode was marketed essentially as "Visual studio for beginners", where you were supposed to move to Visual Studio after you became a real dev, but since then VSCode has been growing and growing and stands now as the most used "IDE", where Visual Studio is mostly seen as "legacy" (oversimplification, great IDE for CPP and .NET but still...).

J_McQuade

Easily VSCode, if we're talking about developer reach. I'm not big into Microsoft stuff, but almost every 'serious' .Net developer I personally know is using Rider, so I can only assume that Visual Studio is retreating to the same space occupied by Eclipse and Netbeans, i.e. still used, but mostly only in places where change is hard.

I'm an emacs user and even I keep a copy of VSCode installed just because I occasionally have to interact with SQL Server and it's really the best way to do that on non-windows systems now that they're winding down ADS.

solarkraft

Most .Net devs I know use VS, I used Rider because it’s so much less awful.

gregd

I only use Rider because it's cross-platform. It's not inherently better (or worse) than Visual Studio with Resharper installed.

pjmlp

Monetarily, Visual Studio.

There are tons of enterprise development workflows, and plugins, that probably will never be ported into VSCode, from their .NET and COM implementations.

Now in terms of mindshare, and gateway drug into Microsoft ecosystem, definitely VSCode.

It is also the best Web IDE, for the return of timesharing development, sorry cloud.

That alone means everyone that is on Github and Azure, gets to use it as the modern version from X Windows and RDP/Citrix sessions.

Not bad, for Eclipse v2 (Enrich Gamma is one of the main architects), pity the whole Electron shell though.

newlisp

It is also the best Web IDE, for the return of timesharing development, sorry cloud.

Also the best webdev IDE.

pphysch

How is VSCode a "gateway drug" into the MS ecosystem? It's good PR, for sure, but it has little to no conceptual/GUI overlap with, say, Windows.

FWIW I use it via Linux .deb and integrate with a private GitLab.

pjmlp

Worrying about Windows is fighting the last war.

Azure, Github, CoPilot, .NET (why do you think it is cross-platform), Java (yes, MS is back in Java land, they were the ones with initial ARM support), Go (they have their own FIPS compliant distro), Python (although with layoffs maybe not anymore), Rust, npm, Powershell, Powerapps, 365 AddIns, Teams plugins, clang/cmake (part of Visual Studio installer), Azure Linux, Sphere OS,....

acdha

Azure and GitHub are large Microsoft revenue sources. Both have first-class VSC integration.

tempodox

Erich Gamma

pjmlp

Thanks for the correction.

jjeaff

it has to be VS Code by a long shot. They don't charge for it, but it serves as an enormous draw to keep people in the MS ecosphere and keeps MS in the developer game.

dontlaugh

Visual Studio is still widely used in the games industry, being pretty much a requirement for targeting some platforms.

It is becoming common for some to use Rider primarily, but VS is still used as part of the build system.

TiredOfLife

> A few years ago VsCode was marketed essentially as "Visual studio for beginners", where you were supposed to move to Visual Studio after you became a real dev,

When was that?

Toritori12

I wont likely find the video but I remember watching the PM for both VSCode and VS (at the time was the same one, not sure now) recommending people to move to Visual Studio "eventually". I clearly remember it because it didn't make any sense, even if the names were similar there were/are nothing alike UI-wise and supported-language-wise. I said few years ago but it was prob around 8 years ago, vsc was still pretty young.

bargainbin

Yeah I’ve been using it since it was released and can’t ever remember it being marketed as such.

weitendorf

The AI integration is interesting to me. I have been trying to get Claude to help me with postgres from within my product and have found its ability and understanding of postgres/sql to be significantly worse than with common programming languages.

Maybe it's because my tolerance for imperfection is much lower for databases than web apps, but it is so bad that I can't trust it for anything database-related beyond text transformations and generating boilerplate queries. It will incorrectly tell me things like postgres doesn't support TABLE OF <TYPE>, or make syntax errors for ON CONFLICT, and immediately agree with any "what about" or "are you sure" I throw at it.

Curious if anybody else has run into this. Obviously LLMs are not always great in specialized domains like this but the poor performance with something as popular as postgres is pretty uncharacteristic IMMO.

dwedge

I think it's more that LLMs are a given percentage (let's say 30%) inaccurate in general, and the results of this inaccuracy are just more immediately obvious with SQL

wolframhempel

Looks amazing- and the point they're making in the article is correct. Switching back and forth from VS to PG Admin creates friction that this seems to solve in a much nicer way