Access your database

Now that you have TimescaleDB setup and running in Timescale Cloud, it's time to connect to your database. While this can be accomplished with many tools, psql is the standard command line interface for interacting with a PostgreSQL or TimescaleDB instance.

Below, we'll verify that you have psql installed and show you how to connect to your TimescaleDB database.

Verify that

Before you start, let's confirm that you already have psql installed. In fact, if you’ve ever installed Postgres or TimescaleDB before, you likely already have psql installed.

In a command line or terminal window, type the following command and press Enter. If psql is installed, it returns the version number. Otherwise, you receive an error.

psql --version


If your client doesn't have psql installed, follow the instructions provided in our How-to guides for Installing psql and then return here.

Connect to your TimescaleDB server

Now that we've confirmed that psql is installed, it's time to connect to your Timescale Cloud instance.

In Timescale Cloud, open the Service Details by clicking on the service that you created in Step 1.

Copy the Service URL from the information displayed. This service URL contains all of the information to connect to your new service except the password.

In a terminal window, type the following command, substituting the Service URL that you just copied for the sample URL shown below:

psql postgres://[USERNAME]:[PASSWORD]@[HOSTNAME]:[PORT]/[DATABASENAME]?sslmode=require


Because the URL provided in the Timescale Cloud interface does not supply the password, you are prompted for the password in order to finish authenticating.

If you want to save yourself time, you can add the password to the URL by adding a colon and the password between the username and the hostname as shown in the placeholder above

Now that you've connected to your Timescale Cloud service, let's look at how to quickly add data so that you can quickly start to explore the power of TimescaleDB.

Found an issue on this page?

Report an issue!


Related Content