Amazon Web Services RDS
Section titled “Amazon Web Services RDS”WAL level
Section titled “WAL level”At a high level, these are the steps necessary to update the WAL level from replica to logical
- Create an RDS parameter group if it doesn't exist
- Update
rds.logical_replicationparameter from 0 to 1 - Apply the parameter group to your RDS instance and restart it
Now let's break down these steps.
Create an RDS parameter group if it doesn't exist by choosing the group family for your PostgreSQL version and specifying a name and description:

Edit the created parameter group:

Find and change the rds.logical_replication parameter from 0 to 1:

Find and modify your RDS instance by using the parameter group:

Apply the modification by restarting your RDS instance:

If you have a Multi-AZ database cluster and you used a cluster parameter group, you will need to explicitly Reboot the Writer instance (it may take ~ 2 seconds if there is not a lot of activity). The Reader endpoint will continue to be available without downtime.

See the AWS RDS user guides to learn more about parameter groups.
Connection
Section titled “Connection”You can specify the same regular database credentials you use to connect to PostgreSQL from your code.
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 userCREATE ROLE [username] WITH LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION PASSWORD '[password]';-- Grant RDS replication permissionGRANT rds_replication TO [username];-- Grant SELECT access to existing 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();-- Create a trigger function that calls the created procedureCREATE OR REPLACE FUNCTION _pgstack_set_replica_identity_func() RETURNS event_trigger AS $$BEGIN CALL _pgstack_set_replica_identity(); END $$ LANGUAGE plpgsql;-- Create a trigger to set REPLICA IDENTITY FULL for all new created tablesCREATE EVENT TRIGGER _pgstack_set_replica_identity_trigger ON ddl_command_end WHEN TAG IN ('CREATE TABLE')EXECUTE FUNCTION _pgstack_set_replica_identity_func();Read-only credentials with manually managed permissions for each table
Section titled “Read-only credentials with manually managed permissions for each table”Run the following queries if you want to isolate read access only to logical replication for certain tables and manage permissions manually instead of using built-in selective tracking in the dashboard.
-- Create read-only userCREATE ROLE [username] WITH LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION PASSWORD '[password]';-- Grant replication permission to allow using replication slotsGRANT rds_replication TO [username];
-- Create "pgstack" PUBLICATION to enable logical replication for selected tablesCREATE PUBLICATION pgstack FOR TABLE [table1], [table2];
-- Set REPLICA IDENTITY FULL for tables to track the "before" state on DB row changesALTER TABLE [table1] REPLICA IDENTITY FULL;ALTER TABLE [table2] REPLICA IDENTITY FULL;To enable data change tracking for a new table:
ALTER PUBLICATION pgstack ADD TABLE [table3];ALTER TABLE [table3] REPLICA IDENTITY FULL;To stop data change tracking for a table:
ALTER PUBLICATION pgstack DROP TABLE [table3];ALTER TABLE [table3] REPLICA IDENTITY DEFAULT;Copyright © 2026 PgStack
