Coordimap
ConfigurationPostgreSQL

PostgreSQL Configuration

Configure PostgreSQL as a Coordimap data source with the right scope_id, read-only credentials, connection settings, and crawl intervals for stable schema visualization.

Configuring A PostgreSQL Data Source In Coordimap

This guide explains how to configure the Coordimap agent to crawl a PostgreSQL server. With PostgreSQL configured correctly, Coordimap can discover databases, schemas, tables, indexes, and relationships, then keep those diagrams updated over time.

For PostgreSQL, use the server or cluster system_identifier as scope_id. That value represents the database lineage more accurately than any Coordimap connector ID or friendly label.

Prerequisites

Before you start, make sure you have:

  1. Installed the Coordimap agent in an environment that can reach the PostgreSQL server.
  2. Added the PostgreSQL data source in the Coordimap UI so you have an id.
  3. Created a read-only PostgreSQL user for the agent.

Use a read-only user

Use a dedicated read-only PostgreSQL user whenever possible. Follow the setup guide here: PostgreSQL Read-Only User.

Find The Correct scope_id

Use the PostgreSQL system identifier:

SELECT system_identifier FROM pg_control_system();

If pg_control_system() is unavailable in your environment, retrieve the same value with PostgreSQL system tooling such as pg_controldata.

Configuration File Structure

coordimap:
  api_key: ${COORDIMAP_API_KEY}
  data_sources:
    - type: postgres
      id: <YOUR_DATA_SOURCE_ID_FROM_UI>
      config:
        - name: scope_id
          value: "<POSTGRES_SYSTEM_IDENTIFIER>"
        - name: db_name
          value: "mydatabase"
        - name: db_host
          value: "postgres.example.com"
        - name: db_port
          value: "5432"
        - name: db_user
          value: "coordimap_readonly_user"
        - name: db_pass
          value: ${POSTGRES_PASSWORD}
        - name: ssl_mode
          value: "require"
        - name: mapping_internal_id
          value: "cloudsql-instance-internal-id"
        - name: crawl_interval
          value: "10m"

Configuration Options

Attribute NameRequiredDescription
typeYesThe data source type. For PostgreSQL this must be postgres.
idYesThe Coordimap data source identifier created in the UI. It identifies the connector record, not the PostgreSQL server identity.
config.name: scope_idYesStable upstream identity for the PostgreSQL server or cluster. Use system_identifier.
config.name: db_nameYesThe PostgreSQL database name to connect to.
config.name: db_hostYesHostname or IP address of the PostgreSQL server.
config.name: db_portNoPostgreSQL port. If omitted, the standard PostgreSQL default is typically used.
config.name: db_userYesDatabase user the agent connects with. Use a read-only user.
config.name: db_passYesPassword for db_user. Prefer an environment variable.
config.name: ssl_modeNoSSL mode such as disable, allow, prefer, require, verify-ca, or verify-full.
config.name: mapping_internal_idNoOptional internal asset identifier used to connect this PostgreSQL metadata source to an existing cloud SQL instance or infrastructure asset.
config.name: crawl_intervalNoHow often the agent refreshes the schema inventory. See Shared Configuration Options.

Why scope_id Matters For PostgreSQL

PostgreSQL assets should stay attached to the same upstream server identity even if you recreate the Coordimap connector or move the crawler. Reusing the same scope_id keeps database object identities stable and avoids duplicate graph objects for the same server lineage.

Next Steps

  1. Create or verify the read-only PostgreSQL user.
  2. Add the PostgreSQL block to the agent YAML file.
  3. Set COORDIMAP_API_KEY and any database password environment variables.
  4. Restart the agent.
  5. Verify that the PostgreSQL schema appears in Coordimap after the next crawl cycle.

Source References

FAQ

What should PostgreSQL use as scope_id?

Use the PostgreSQL system_identifier. It represents the server or cluster lineage better than a hostname, database name, or Coordimap connector ID.

When should I use mapping_internal_id?

Use mapping_internal_id when you need to connect PostgreSQL schema metadata to an existing infrastructure asset, such as a cloud SQL instance already discovered by another data source.

Does the PostgreSQL user need write permissions?

No. Use a dedicated read-only user so the agent can inspect schema metadata without modifying application data.

On this page