logo
icon

PostgreSQL (with PostGIS)

The PostgreSQL distribution with PostGIS included

template cover
Deployed5 times
Publisherpan93412
Created2024-09-12
Services
service icon
Tags
Database

PostgreSQL is a free and open-source relational database management system that emphasizes extensibility and SQL compliance. PostGIS extends the capabilities of PostgreSQL by adding support for storing, indexing, and querying geospatial data.

Configuration

It is a one-click deployment, so you rarely need to configure PostgreSQL after deployment.

You can configure PostgreSQL by editing the file /etc/postgresql/postgresql.conf with Config Editor. We have pre-configured some of the essential settings for you.

Connection

The "Instruction" section contains the root username, password, and the default database of your PostgreSQL instance. It also provides the connection string and command for you to connect from outside.

If you want to access your PostgreSQL in your other services (inter-service), you can reference the exposed variable POSTGRES_CONNECTION_STRING in your service with ${POSTGRES_CONNECTION_STRING}. For more flexible cases, you can reference these variables:

  • POSTGRES_HOST: The hostname of this PostgreSQL instance for private networking.
  • POSTGRES_PORT: The port of this PostgreSQL instance for private networking.
  • POSTGRES_DATABASE: The default database of this PostgreSQL instance.
  • POSTGRES_USERNAME: The default root username of this PostgreSQL instance.
  • POSTGRES_PASSWORD: The default root password of this PostgreSQL instance.

If your project contains multiple PostgreSQL instances, the reference variable might be unreliable (it may pick the exposed variable of another PostgreSQL instance). In this case, manually specifying the PostgreSQL instance's hostname and port is recommended.

To find your PostgreSQL instance's hostname and port for private networking, check the "Networking" tab of your PostgreSQL instance, and you will see the hostname suffixed with zeabur.internal and the port that you can use to connect to this PostgreSQL instance.