Upstream PostgreSQL
Section titled “Upstream PostgreSQL”PgStack Audit reads committed row changes from your upstream PostgreSQL using logical replication. Your applications continue connecting to the same database.
Connection
Section titled “Connection”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.
WAL level
Section titled “WAL level”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:
Selective tracking
Section titled “Selective tracking”Tracking by tables
Section titled “Tracking by tables”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.
Ignoring by columns
Section titled “Ignoring by columns”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.
SSH tunnel
Section titled “SSH tunnel”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.

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:
touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keysecho 'ssh-ed25519 AAAAC3Nz...' >> ~/.ssh/authorized_keysThen select Verify Connection in PgStack.
VPN tunnel
Section titled “VPN tunnel”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.
Static IPs
Section titled “Static IPs”If your database requires IP allowlisting, contact us for the source addresses to allow. Scope database access to the required hosts and ports.
Disconnecting
Section titled “Disconnecting”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.
Remove application context triggers
Section titled “Remove application context triggers”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;Remove replication resources
Section titled “Remove replication resources”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;Copyright © 2026 PgStack
