PostgreSQL

PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.

Add a database to your application

To add a dedicated PostgreSQL instance to your existing application, simply add these lines to your configuration file:

.qovery.yml
application:
...
databases:
- type: postgresql
version: 12
name: my-postgresql
  • name: select a name for your database
  • version: choose the version of the database
  • type: the database engine (postgresql in this case)

Alternatively, if you are creating a new application, use qovery init to interactively add a database (the CLI asks if you need one).

Supported versions

Here are the PostgreSQL versions supported by Qovery.

VersionSupported
12Yes
11Yes
10Yes
9Yes

Qovery does not support a new version of PostgreSQL yet? Contact us

Get access to a database

To get the connection information of your database, you can use the CLI:

qovery application env list -c
OUTPUT
$ qovery application env list -c
SCOPE | KEY | VALUE
--------------+---------------------------------------------------------------+-----------
BUILT_IN | QOVERY_BRANCH_NAME | master
BUILT_IN | QOVERY_IS_PRODUCTION | true
BUILT_IN | QOVERY_DATABASE_MY_POSTGRESQL_NAME | my-postgresql
BUILT_IN | QOVERY_DATABASE_MY_POSTGRESQL_TYPE | postgresql
BUILT_IN | QOVERY_DATABASE_MY_POSTGRESQL_VERSION | 12
BUILT_IN | QOVERY_DATABASE_MY_POSTGRESQL_CONNECTION_URI | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_POSTGRESQL_CONNECTION_URI_WITHOUT_CREDENTIALS | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_POSTGRESQL_HOST | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_POSTGRESQL_FQDN | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_POSTGRESQL_PORT | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_POSTGRESQL_USERNAME | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_POSTGRESQL_PASSWORD | <hidden>
BUILT_IN | QOVERY_DATABASE_MY_POSTGRESQL_DATABASE | postgresql

In the output, you get all data you need to use the database. Those environment variables are available in the runtime of your application.

Get database status

To know more about your database status, run:

qovery status -c
OUTPUT
DATABASE NAME | STATUS | TYPE | VERSION | ENDPOINT | PORT | USERNAME | PASSWORD | APPLICATIONS
----------------+---------+---------+---------+----------+----------+----------+----------+-----------------
my-mongo | running | postgresql | 12 | <hidden> | <hidden> | <hidden> | <hidden> | simple-example

Delete a database

To delete a database, you have two options:

  • Remove it from the configuration file, commit and push
  • If you worked on a feature branch, delete the branch, and the database instance automatically deletes as well

Backups

You can change the window very easily (use 24h format):

.qovery.yml
application:
...
databases:
- name: my-postgresql
type: postgresql
backup-window: 21-23

As described in the configuration file, the backup occurs between 9 PM and 11 PM.