Skip to content

PgStack Audit reads committed row changes from your upstream PostgreSQL using logical replication. Your applications continue connecting to the same database.

In your project's Audit settings, provide:

  • Host
  • Database
  • Port
  • User
  • Password

Use a direct PostgreSQL endpoint that supports replication rather than a transaction pooler. The connection must have the replication and table permissions required by your provider.

Check the current setting:

SHOW wal_level;

On PostgreSQL 18 and earlier, the value must be logical. Changing it requires a restart; follow your provider's configuration process. On PostgreSQL 19, replica also supports logical replication: creating the first logical replication slot automatically raises the effective WAL level to logical without a restart.

Choose your hosting guide:

Choose which tables Audit tracks during setup or in the project's Audit settings. Review the selection when adding tables or schemas. Changes on excluded tables are not included in your Audit history.

Ignore-column rules suppress an update when only ignored values change. For example, ignoring public.tableName.updatedAt prevents a new history entry when only updatedAt changes. If another tracked column changes too, the entry still contains the row's values, including updatedAt.

PgStack connects to private PostgreSQL through a public SSH jump host

For databases on private networks, an SSH jump host can provide connectivity. Configure the tunnel using the connection details shown during setup, and authorize the generated public key on your jump host.

SSH connection settings showing the generated public key

On the jump host, sign in as the configured SSH user and add the generated public key to ~/.ssh/authorized_keys. Replace ssh-ed25519 AAAAC3Nz... with the full public key shown in your connection settings:

Terminal window
touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys
echo 'ssh-ed25519 AAAAC3Nz...' >> ~/.ssh/authorized_keys

Then select Verify Connection in PgStack.

A private VPN node establishes a tunnel to PgStack for PostgreSQL connectivity

A VPN node in your private network establishes a tunnel to PgStack using hole punching, allowing PgStack to reach upstream PostgreSQL without exposing the database to the internet. Contact us to coordinate the network ranges, peer configuration, and database address before configuring a tunnel.

If your database requires IP allowlisting, contact us for the source addresses to allow. Scope database access to the required hosts and ports.

Disable Audit for the project before removing its replication resources. Confirm the replication slot, publication, and integration triggers used by your project, and check that no other consumers depend on them before cleanup.

If you used one of the supported ORM integrations, run the following queries to remove the lightweight triggers used to pass application context:

DROP EVENT TRIGGER _pgstack_create_table_trigger;
DROP FUNCTION _pgstack_create_table_trigger_func;
DROP PROCEDURE _pgstack_create_triggers;
DROP FUNCTION _pgstack_row_trigger_func CASCADE;

To stop logical replication for Audit, remove its replication slot and publication. Dropping the replication slot discards the consumer's position. If you enable Audit again later, PgStack cannot recover changes missed while replication was disabled.

The following queries use the default resource names:

SELECT pg_drop_replication_slot('pgstack');
DROP PUBLICATION pgstack;