One of the things that got me really excited and curious about Neon, long before I joined the company, was the psql -h pg.neon.tech command. I’ve recently come to find out that other employees here went through the same “wow” experience even before they joined the company. So, I’ve decided to write a little bit about how to use it, how it works and why it’s so useful.
And then by clicking on that URL, you are taken into the Neon console, where you can choose which Neon project you’d like to connect to. If your project only has one endpoint, then the flow is really quick, but otherwise you have to specify which endpoint you want to connect to.
Once I joined Neon, I decided to try and figure out how this feature works under the hood. And it all starts with what’s running at pg.neon.tech. Is it a real Postgres instance? No, it’s not — it’s just a server that speaks Postgres protocol that we call “Link Proxy”.
So, the Postgres protocol has a “message flow” that can be used for many different things. One of the message types that the server can respond with to the “Start-up” message from the client is “NoticeResponse”. As per the docs, this is what it should be used for: