PG_CREATESUBSCRIBER(1) PostgreSQL 18.6 Documentation PG_CREATESUBSCRIBER(1) (NAME) pg_createsubscriber - (SYNOPSIS) pg_createsubscriber [...] {-d | --database}dbname {-D | --pgdata}datadir {-P | --publisher-server}connstr (DESCRIPTION) pg_createsubscriber . . (publication) (subscription) . . . pg_createsubscriber . pg_createsubscriber . pg_createsubscriber . ( ) . . copy_data CREATE SUBSCRIPTION . (OPTIONS) pg_createsubscriber : -a --all . (template) . --publisher-server postgres template1 . . --database --publication --replication-slot --subscription . -d dbname --database=dbname . -d . -a . -d -P . -d -P -a . -D directory --pgdata=directory . -n --dry-run . -p port --subscriber-port=port . 50432 . -P connstr --publisher-server=connstr (publisher). 32.1.1 . -s dir --socketdir=dir postmaster . . -t seconds --recovery-timeout=seconds (recovery). 0 . 0 . -T --enable-two-phase (two_phase commit) . . false . -U username --subscriber-username=username . . -v --verbose . pg_createsubscriber . (debug) . --clean=objtype (drop) . o publications: FOR ALL TABLES . --dry-run. pg_dump . --config-file=filename . pg_createsubscriber pg_ctl . postgresql.conf . --publication=name . --publication . . . . --all . --replication-slot=name . --replication-slot . . . . --all . --subscription=name . --subscription . . . . --all . -V --version pg_createsubscriber . -? --help pg_createsubscriber . (NOTES) (Prerequisites) pg_createsubscriber . . pg_createsubscriber . . pg_replication_origin_advance() . . max_active_replication_origins max_logical_replication_workers . max_worker_processes . . --enable-two-phase max_prepared_transactions . . . wal_level logical . max_replication_slots . max_wal_senders WAL . (Warnings) pg_createsubscriber . . pg_createsubscriber . . DDL pg_createsubscriber DDL . DDL . pg_createsubscriber ( ) . . . . primary_slot_name . pg_createsubscriber . --enable-two-phase pg_createsubscriber . (prepared transaction) COMMIT PREPARED . () two_phase . pg_createsubscriber pg_resetwal . WAL . . WAL . max_slot_wal_keep_size -1 WAL . (How It Works) : 1. . pg_createsubscriber . 2. . . pg_createsubscriber . 3. . FOR ALL TABLES . --publication : "pg_createsubscriber_%u_%x" (: oid int). --replication-slot : "pg_createsubscriber_%u_%x" (: oid int). . LSN recovery_target_lsn . . 4. . LSN ( recovery_target_lsn) (WAL) . promote . (WAL ) . / . --recovery-timeout pg_createsubscriber . 5. . --subscription : "pg_createsubscriber_%u_%x" (: oid int). . . . . . 6. . . 7. . . LSN . . pg_replication_origin_advance() . 8. . . 9. primary_slot_name . 10. failover . 11. . pg_resetwal(1) . pg_resetwal . (EXAMPLES) hr finance foo: $ pg_createsubscriber -D /usr/local/pgsql/data -P "host=foo" -d hr -d finance (SEE ALSO) pg_basebackup(1) PostgreSQL 18.6 2026 PG_CREATESUBSCRIBER(1)