Skip to content

External PostgreSQL

Run the MetaMiner Database (MMDB) on a PostgreSQL 16 or newer server that your DBA manages, instead of the embedded database.

Before you begin

  • A PostgreSQL server, version 16 or newer, reachable from the MetaMiner Server on its port (5432 by default). Power BI collection does not run on older versions.
  • An empty database for MetaMiner, UTF-8 encoded.
  • A login role for MetaMiner that owns the database and can create schemas and objects in it.
  • The login role can create roles: at every start the MetaMiner Server (MMS) creates or updates the read-only role readonly and the MetaQuery roles mq_reader and mq_reader_all.
  • Optional: SSL enabled on the PostgreSQL server.

PostgreSQL 16 is a hard requirement for Power BI

On PostgreSQL 15 or older, MMS skips the Power BI schema and collects nothing for Power BI, and MMA disables enabled Power BI environments with "Power BI environments require PostgreSQL 16 or newer for MetaMiner MMDB." Contact Infolytik Support before upgrading an existing MMDB.

TODO: confirm the exact privileges needed

Source: the read-only role is created at every start, which needs CREATEROLE. Confirm whether CREATEROLE alone is sufficient or whether the login must be a superuser for the MetaMiner role settings (statement and temp-file limits).

Steps

  1. Ask your DBA to create the database and login role, for example:

    Run as a PostgreSQL administrator
    CREATE ROLE metaminer_owner LOGIN PASSWORD '<password>' CREATEROLE;
    CREATE DATABASE metaminer OWNER metaminer_owner ENCODING 'UTF8' TEMPLATE template0;
    
  2. In MMA, stop the server if it is running.

  3. Click Configure MMDB.
  4. Set Active DB Type: to Postgres.
  5. Enter DBMS Host:, Port:, DB Name:, Username: and Password:. Check SSL if the server requires encrypted connections.
  6. Click Validate and Close. MMA checks the PostgreSQL version; on a version older than 16 it disables enabled Power BI environments.
  7. Start the server. MMS creates all schemas on the first start; this takes a few minutes.

Image of the Configure MMDB dialog with Postgres selected and the connection fields filled

../../images/admin/configure-mmdb-external.png

Switching does not move data

Changing Active DB Type points MetaMiner at a different database; it does not copy metadata. MetaMiner then collects every tenant again from the start, and activity older than what Microsoft still returns (about 30 days) is lost. To keep history, copy the existing MMDB first; see Back Up and Restore MMDB.

Verify

  • server\logs\server.log shows the schema updates completing and no database errors.
  • The MMA health indicator shows no red state.
  • After the first collection cycles, the tenant appears in the MetaMiner Client.

Troubleshooting

Validation fails in Configure MMDB

Check host, port, database name, login and password, pg_hba.conf on the PostgreSQL server (the MetaMiner Server address must be allowed), and SSL settings.

The server fails to start after switching

Look for permission errors in server.log. The login must be able to create schemas, objects and roles. Database updates are designed not to depend on specific role names, so they also work when the database owner is not mmuser.

Power BI data does not appear

Check the PostgreSQL version with SELECT version();. Below 16, server.log contains an error that Power BI is blocked by the PostgreSQL version.

Database updates fail on start

A failed update is logged with its number and is retried at the next start. Contact Infolytik Support with the log.

Next steps