icon

PostgreSQL (with PostGIS and pgvector)

PostgreSQL distribution with PostGIS (geospatial data) and pgvector (vector similarity search) extensions included.

template cover
Deployed3 times
Publisherbryanlin16899
Created2025-05-10
Services
service icon
Tags
DatabasepgvectorPostGIS

PostgreSQL is a free and open-source relational database management system that emphasizes extensibility and SQL compliance. This template deploys PostgreSQL with two powerful extensions:

  • PostGIS: Adds support for storing, indexing, and querying geospatial data.
  • pgvector: Enables storing and searching vector embeddings for AI applications, similarity search, etc.

Configuration

This is a one-click deployment, so you rarely need to configure PostgreSQL after deployment. Both PostGIS and pgvector extensions should be available to be enabled in your database.

  • Enable pgvector extension
CREATE EXTENSION IF NOT EXISTS vector;
  • Enable PostGIS extension
CREATE EXTENSION IF NOT EXISTS postgis;

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. 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.