How Does psql -h pg.neon.tech Work?
Blog post from Neon
The "psql -h pg.neon.tech" command is a feature of Neon that enables users to connect to Neon projects seamlessly through a passwordless authentication process. When executed in the command line interface, it generates a URL that directs users to the Neon console, where they can select the desired project or compute endpoint. This functionality relies on a server known as "Link Proxy," which mimics a Postgres instance and uses the Postgres protocol to display a welcome message and facilitate connections. Neon employs a control plane and data plane architecture, where the Link Proxy operates within the data plane to handle connections and forward traffic between the client and the database. This tool simplifies managing multiple projects or endpoints by eliminating the need to track numerous URLs or credentials. Additionally, both the Neon Proxy and Link Proxy are open-source, allowing users to explore the codebase and engage with the Neon community for support.