WAL level
Section titled “WAL level”To enable logical replication in Neon:
- Select your project in the Neon Console.
- On the Neon Dashboard, select Settings.
- Select Beta.
- Click Enable to enable logical replication. This will set the PostgreSQL
wal_levelsetting tological.
Connection
Section titled “Connection”To connect a Neon PostgreSQL database, specify your database credentials, which can be found on your Neon project's dashboard:
Note: Use the Host name without enabling the "Pooled connection" option.

For a provider-specific setup guide, see the Neon integration guide, in the Neon documentation.
Read-only credentials
Section titled “Read-only credentials”Alternatively, you can manually create read-only PostgreSQL database credentials to connect to the primary instance's WAL. The commands below configure replication permissions. PgStack attempts to configure replica identity automatically when permitted. If the connection lacks the required permissions, run the replica identity commands below with a user that has them.
CREATE ROLEcreates a new read-only user for PgStack Audit to read database changes.CREATE PUBLICATIONcreates a "channel" that we'll subscribe to and track changes in real-time.
-- Create read-only user with REPLICATION permissionCREATE ROLE [username] WITH LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE REPLICATION PASSWORD '[password]';-- Grant SELECT access to tables for selective trackingGRANT SELECT ON ALL TABLES IN SCHEMA public TO [username];-- Grant SELECT access to new tables created in the future for selective trackingALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO [username];
-- Create "pgstack" PUBLICATION to enable logical replicationCREATE PUBLICATION pgstack FOR ALL TABLES;
-- Create a procedure to set REPLICA IDENTITY FULL for tables to track the "before" state on DB row changesCREATE OR REPLACE PROCEDURE _pgstack_set_replica_identity() AS $$ DECLARE current_tablename TEXT;BEGIN FOR current_tablename IN SELECT tablename FROM pg_tables LEFT JOIN pg_class ON relname = tablename WHERE schemaname = 'public' AND relkind != 'f' AND relreplident != 'f' LOOP EXECUTE format('ALTER TABLE %I REPLICA IDENTITY FULL', current_tablename); END LOOP;END $$ LANGUAGE plpgsql;-- Call the created procedureCALL _pgstack_set_replica_identity();Copyright © 2026 PgStack
