Skip to main content
Oleria provides identity security and access management teams with visibility and intelligence into who has access to what, where they got that access, how they use it, and whether they should even have it. As part of that promise, we integrate your PostgreSQL databases into the Oleria platform, giving you visibility into every role, grant, and access path across self-hosted or cloud-managed Postgres. This document provides step-by-step guidance for integrating PostgreSQL with your Oleria workspace.
This integration supports self-hosted PostgreSQL, Google Cloud SQL, AWS RDS/Aurora, and Azure Database for PostgreSQL Flexible Server. Pick the setup path that matches your deployment below.

What Oleria discovers

Prerequisites

  • A PostgreSQL role with CONNECT privilege on every database you want Oleria to see. Discovery doesn’t require superuser.
  • Cloud-provider credentials matching your deployment - see Set up the integration below.
  • Optional: grant that same role CREATEROLE (or superuser), if you also want to run remediation actions.
PostgreSQL superusers bypass every object-level grant. Rather than showing a misleadingly empty access list for a superuser account, Oleria models that bypass explicitly as access to every database.

Set up the integration

1

Create a connector role

Connect as an admin and create a role for Oleria:
Repeat the GRANT CONNECT for every database you want Oleria to see.
To also run remediation actions, grant CREATEROLE instead of a plain role: ALTER ROLE oleria_connector WITH CREATEROLE;
2

Enable pgaudit for activity (optional)

Oleria reads activity directly from your PostgreSQL log file over the same connection, using pg_read_file() - no separate log shipping is needed.
This approach requires PostgreSQL to write logs to a file at a known path. It does not work with the official Postgres Docker image (which logs to container stdout) or deployments that route logs to syslog or systemd journal only. For those setups, skip this step - Oleria will connect successfully but won’t show activity.
  1. Install the pgaudit extension and enable it in postgresql.conf:
log_line_prefix must include both %p (the backend process id) and %u (the session user). %p lets Oleria correlate a pgaudit entry with the connection it came from to fill in the client IP and database; %u attributes the entry to the right actor. Dropping either still captures entries, but with a blank actor (%u) or blank IP/database (%p).
pgaudit has no dedicated class for connect/disconnect events - those come from PostgreSQL’s own log_connections/log_disconnections output, which default to off. Without them, DDL and role changes are still captured, but no connect/disconnect activity will show up.
  1. Restart PostgreSQL, then run CREATE EXTENSION pgaudit; in each database.
  2. Reading the log file requires two separate grants, not just one - a role with only pg_read_server_files will still fail:
pg_read_server_files covers reading the log file itself, but Oleria also calls pg_current_logfile() to locate it, and PostgreSQL restricts that function to superuser by default (and, from PostgreSQL 17 only, the pg_monitor role). The explicit GRANT EXECUTE above works on every supported version. Skipping this step doesn’t break setup; Oleria simply won’t show activity.

Connect PostgreSQL to Oleria

1

Open the integration

Log in to your Oleria workspace and navigate to Integrations -> PostgreSQL -> Connect.
2

Complete the connection form

Select your Cloud Provider first - the form updates to show only the fields that provider needs.
Oleria auto-detects your pgaudit log file’s path via pg_current_logfile() - there is no field to override it today. If your log file lives somewhere Postgres doesn’t report (an unusual logging setup), contact Oleria Support.
3

Complete the connection

Oleria validates the connection, discovers your PostgreSQL roles, resources, and access, and begins the first sync.

Verify the integration

Confirm PostgreSQL appears in your Oleria workspace’s connected integrations. After the first sync completes, you can review the discovered roles, resources, access grants, and activity in your Oleria workspace.

Remediation actions

Both remediation actions need the connector role to hold CREATEROLE or superuser, and both require approval before Oleria runs them.

Known limitations

  • No account lifecycle: Oleria can grant or revoke role membership, but can’t create, disable, or delete a PostgreSQL role. This integration remediates access, not identity lifecycle.
  • Synthetic email: PostgreSQL roles have no native email field. Oleria synthesizes one from the role name and connection host, which may not match a real address used elsewhere in your organization.
  • Auth method visibility: Oleria can show a role’s configured authentication method only when the connector role is a true superuser able to call pg_hba_file_rules(). This is unavailable on Google Cloud SQL, which restricts that function even for superuser-equivalent roles - Oleria falls back gracefully with no error.
  • Column-level grants: only columns with an explicit grant are inventoried; columns covered solely by a table-wide grant aren’t listed individually.

Contact us

For questions about this integration, contact us at support@oleria.com.