Getting started with Aiven for PostgreSQL®#
Aiven for PostgreSQL® is available in the Aiven console.
Create an Aiven for PostgreSQL® service#
Log in to the Aiven web console.
Follow these instructions to create a new Aiven for PostgreSQL service.
Once the service is ready, the status changes to Running. This typically takes a couple of minutes, depending on your selected cloud provider and region.
Connect to PostgreSQL with psql
#
Log in to Aiven Console.
Navigate to your service’s page, and select Overview for the left sidebar.
In the Connection information section, identify Service URI, which is the direct PostgreSQL connection endpoint.
See also
For more information on direct connections and connection pooling, visit the dedicated page.
Use psql to connect to the PostgreSQL instance by the following command:
psql SERVICE_URI_OF_YOUR_SERVICE
Load a test dataset in PostgreSQL#
If you’re checking out PostgreSQL, loading a test dataset will give you something to look at. This example uses
dellstore2
, a standard store dataset with products, orders, inventory and customer information.
Download the
dellstore2-normal-1.0.tar.gz
file from the PostgreSQL website and unzip it.Navigate to the
dellstore2-normal-1.0
folder on your terminal.Connect to your PostgreSQL instance with
psql
as shown above.Create a
dellstore
database and connect to it with the following command frompsql
:CREATE DATABASE dellstore; \c dellstore
Tip
Your
psql
terminal prefix will change todellstore==>
when you are connected to the correct database.Populate the database by executing the following command from
psql
:\i dellstore2-normal-1.0.sql
Verify which objects have been created from
psql
:\d
The output should look like this:
List of relations
Schema | Name | Type | Owner
--------+--------------------------+----------+----------
public | categories | table | avnadmin
public | categories_category_seq | sequence | avnadmin
public | cust_hist | table | avnadmin
public | customers | table | avnadmin
public | customers_customerid_seq | sequence | avnadmin
public | inventory | table | avnadmin
public | orderlines | table | avnadmin
public | orders | table | avnadmin
public | orders_orderid_seq | sequence | avnadmin
public | products | table | avnadmin
public | products_prod_id_seq | sequence | avnadmin
public | reorder | table | avnadmin
(12 rows)
See also
Code examples for connecting to PostgreSQL from your application:
How to use PgAdmin with Aiven for PostgreSQL
Learn PostgreSQL with some PostgreSQL Exercises
The awesome PostgreSQL ecosystem of tools and solutions