Join us on March 29th for Developer Days!Learn More

Passwordless connect

Neon's psql passwordless connect feature helps you quickly authenticate a connection to Neon without having to provide a password.

The following instructions require a working installation of psql, an interactive terminal for working with PostgreSQL. For information about psql, refer to the psql reference, in the PostgreSQL Documentation.

To connect using Neon's psql passwordless connect feature:

  1. In your terminal, run the following command:

    psql -h

    A response similar to the following is displayed:

    NOTICE:  Welcome to Neon!
    Authenticate by visiting:
  2. In your browser, navigate to the provided link where you are asked to select a Neon project to connect to. If your project has more than one compute endpoint, you are also asked to select one. Select the compute endpoint that is associated with the branch you want to connect to.

    After making your selection, you are directed to check the terminal where information similar to the following is displayed:

    NOTICE:  Connecting to database.
    psql (15.0 (Ubuntu 15.0-1.pgdg22.04+1))
    Type "help" for help.

    When using passwordless connect, the psql prompt shows your local terminal user name. However, you are logged in with the Neon web_access role, which you can verify by running this query:

    SELECT current_user;

    The passwordless connect feature connects to the first database created in the branch. To check the database you are connected to, issue this query:

    SELECT current_database();

    Switching databases from the psql prompt (using \c <database_name>, for example) after you have authenticated restarts the passwordless connect authentication process to authenticate a connection to the new database.

Running queries

After establishing a connection, try running the following queries:

CREATE TABLE my_table AS SELECT now();
SELECT * FROM my_table;

The following result set is returned:

 2022-09-11 23:12:15.083565+00
(1 row)

Need help?

Send a request to, or join the Neon community forum.

Edit this page
Was this page helpful?