Create a PostgreSQL database in TIR and connect to it from your own computer with psql.
You need:
- A TIR project in Chennai, and permission to create databases in it. See TIR Access Control.
- Enough credit on your account to launch the database, if your account is prepaid.
- psql, the PostgreSQL command-line client, installed on your computer.
Create the database
Section titled “Create the database”- In your project, open Databases > DBaaS and select Create Database.
- Keep the name TIR suggests, or enter your own. A name is 3 to 50 characters of lowercase letters, numbers, and hyphens. It starts with a letter and ends with a letter or number.
- Keep Username as
admin. In Password, select Suggest to fill in a strong password, then copy it and keep it somewhere safe. You need it to connect. - Keep the suggested PostgreSQL version, compute plan, and 100 GB disk.
- Under Network & Security, in IP Allowlist, select Add my IP. This adds the address you are browsing from, so that your computer can reach the database. If Add my IP is unavailable, type your computer’s public IPv4 address and select Add. Leave VPC empty.
- Check Estimated cost, then select Launch Database. Prices are on E2E’s pricing page.
TIR opens the database’s page and sets it up while its status is Creating. When the database is ready, it turns Running.
Every choice on the form is explained in Create a database.
Connect with psql
Section titled “Connect with psql”- Open the Connect tab and keep Connect as on
admin. - Under Copy it into your app, select Copy psql.
- Paste the
psqlcommand into a terminal and replace<password>with the password you saved. You always fill in the password yourself. - Run the command.
psql connects over SSL to defaultdb, the database that every new TIR database starts with, and
its prompt starts with defaultdb. The line SSL connection above the prompt confirms
that the connection is encrypted. Try a first query:
SELECT version();If the connection fails, check that the address you are connecting from is in the IP allowlist. The Troubleshooting TIR DBaaS page has the fixes for other messages.
What to do next
Section titled “What to do next”- Connect to a database gives the connection string for your app, with snippets for Python, Node.js, Java, and other frameworks.
- How TIR DBaaS works explains the endpoints, the IP allowlist, and what each status means.
- Schedule snapshots so that you can go back to an earlier copy of your data.
- Delete a database when you have finished trying it out.