1. Command: ./pg_createsubscriber -D standby/ -P "host=localhost port=5432 dbname=postgres" -d db2 --publication pub2 --clean=publications --dry-run --verbose Output: shubham@shubham-Virtual-Machine:~/Project/Git/postgres/inst/bin$ sh test_script.sh The files belonging to this database system will be owned by user "shubham". This user must also own the server process. The database cluster will be initialized with locale "en_IN". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are enabled. creating directory data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default "max_connections" ... 20 selecting default "shared_buffers" ... 400kB selecting default time zone ... Asia/Kolkata creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D data -l logfile start waiting for server to start.... done server started CREATE ROLE slot_name | lsn -----------+------------ replica_1 | 0/018ED790 (1 row) waiting for server to shut down.... done server stopped waiting for server to start.... done server started CREATE DATABASE CREATE DATABASE CREATE TABLE CREATE TABLE CREATE TABLE CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION 37878/37878 kB (100%), 1/1 tablespace waiting for server to start.... done server started ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM waiting for server to shut down.... done server stopped pg_createsubscriber: validating publisher connection string pg_createsubscriber: validating subscriber connection string pg_createsubscriber: checking if directory "standby" is a cluster data directory pg_createsubscriber: getting system identifier from publisher pg_createsubscriber: system identifier is 7556914823016805018 on publisher pg_createsubscriber: getting system identifier from subscriber pg_createsubscriber: system identifier is 7556914823016805018 on subscriber pg_createsubscriber: starting the standby server with command-line options 2025-10-03 14:19:16.716 IST [1585911] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:19:16.718 IST [1585911] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:19:16.731 IST [1585917] LOG: database system was shut down in recovery at 2025-10-03 14:19:15 IST 2025-10-03 14:19:16.732 IST [1585917] LOG: entering standby mode 2025-10-03 14:19:16.736 IST [1585917] LOG: redo starts at 0/03000028 2025-10-03 14:19:16.736 IST [1585917] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:19:16.736 IST [1585911] LOG: database system is ready to accept read-only connections 2025-10-03 14:19:16.742 IST [1585918] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: checking settings on subscriber pg_createsubscriber: checking settings on publisher pg_createsubscriber: warning: two_phase option will not be enabled for replication slots pg_createsubscriber: detail: Subscriptions will be created with the two_phase option disabled. Prepared transactions will be replicated at COMMIT PREPARED. pg_createsubscriber: hint: You can use the command-line option --enable-two-phase to enable two_phase. pg_createsubscriber: warning: required WAL could be removed from the publisher pg_createsubscriber: hint: Set the configuration parameter "max_slot_wal_keep_size" to -1 to ensure that required WAL files are not prematurely removed. pg_createsubscriber: stopping the subscriber 2025-10-03 14:19:16.855 IST [1585911] LOG: received fast shutdown request 2025-10-03 14:19:16.858 IST [1585911] LOG: aborting any active transactions 2025-10-03 14:19:16.859 IST [1585918] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:19:16.865 IST [1585915] LOG: shutting down 2025-10-03 14:19:16.878 IST [1585911] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: creating publication "pub2" in database "db2" pg_createsubscriber: create publication "pub2" in database "db2" pg_createsubscriber: creating the replication slot "pg_createsubscriber_16386_e9a70df3" in database "db2" pg_createsubscriber: create replication slot "pg_createsubscriber_16386_e9a70df3" on publisher pg_createsubscriber: starting the subscriber 2025-10-03 14:19:17.005 IST [1585930] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:19:17.007 IST [1585930] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:19:17.025 IST [1585936] LOG: database system was shut down in recovery at 2025-10-03 14:19:16 IST 2025-10-03 14:19:17.026 IST [1585936] LOG: entering standby mode 2025-10-03 14:19:17.030 IST [1585936] LOG: redo starts at 0/03000028 2025-10-03 14:19:17.030 IST [1585936] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:19:17.030 IST [1585930] LOG: database system is ready to accept read-only connections 2025-10-03 14:19:17.039 IST [1585937] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: waiting for the target server to reach the consistent state pg_createsubscriber: target server reached the consistent state pg_createsubscriber: hint: If pg_createsubscriber fails after this point, you must recreate the physical replica before continuing. pg_createsubscriber: dropping all existing publications in database "db2" pg_createsubscriber: dropping publication "pub2" in database "db2" pg_createsubscriber: creating subscription "pg_createsubscriber_16386_e9a70df3" in database "db2" pg_createsubscriber: setting the replication progress (node name "pg_0", LSN 0/00000000) in database "db2" pg_createsubscriber: enabling subscription "pg_createsubscriber_16386_e9a70df3" in database "db2" pg_createsubscriber: stopping the subscriber 2025-10-03 14:19:17.147 IST [1585930] LOG: received fast shutdown request 2025-10-03 14:19:17.150 IST [1585930] LOG: aborting any active transactions 2025-10-03 14:19:17.151 IST [1585937] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:19:17.157 IST [1585934] LOG: shutting down 2025-10-03 14:19:17.174 IST [1585930] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: modifying system identifier of subscriber pg_createsubscriber: system identifier is 7556914887256519405 on subscriber pg_createsubscriber: running pg_resetwal on the subscriber pg_createsubscriber: Done! 2. Command: ./pg_createsubscriber -D standby/ -P "host=localhost port=5432 dbname=postgres" -d db2 --publication pub2 --dry-run --verbose Output: shubham@shubham-Virtual-Machine:~/Project/Git/postgres/inst/bin$ sh test_script.sh The files belonging to this database system will be owned by user "shubham". This user must also own the server process. The database cluster will be initialized with locale "en_IN". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are enabled. creating directory data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default "max_connections" ... 20 selecting default "shared_buffers" ... 400kB selecting default time zone ... Asia/Kolkata creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D data -l logfile start waiting for server to start.... done server started CREATE ROLE slot_name | lsn -----------+------------ replica_1 | 0/018ED790 (1 row) waiting for server to shut down.... done server stopped waiting for server to start.... done server started CREATE DATABASE CREATE DATABASE CREATE TABLE CREATE TABLE CREATE TABLE CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION 37878/37878 kB (100%), 1/1 tablespace waiting for server to start.... done server started ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM waiting for server to shut down.... done server stopped pg_createsubscriber: validating publisher connection string pg_createsubscriber: validating subscriber connection string pg_createsubscriber: checking if directory "standby" is a cluster data directory pg_createsubscriber: getting system identifier from publisher pg_createsubscriber: system identifier is 7556915190528430937 on publisher pg_createsubscriber: getting system identifier from subscriber pg_createsubscriber: system identifier is 7556915190528430937 on subscriber pg_createsubscriber: starting the standby server with command-line options 2025-10-03 14:20:41.904 IST [1586103] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:20:41.906 IST [1586103] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:20:41.919 IST [1586109] LOG: database system was shut down in recovery at 2025-10-03 14:20:40 IST 2025-10-03 14:20:41.919 IST [1586109] LOG: entering standby mode 2025-10-03 14:20:41.922 IST [1586109] LOG: redo starts at 0/03000028 2025-10-03 14:20:41.923 IST [1586109] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:20:41.923 IST [1586103] LOG: database system is ready to accept read-only connections 2025-10-03 14:20:41.929 IST [1586110] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: checking settings on subscriber pg_createsubscriber: checking settings on publisher pg_createsubscriber: warning: two_phase option will not be enabled for replication slots pg_createsubscriber: detail: Subscriptions will be created with the two_phase option disabled. Prepared transactions will be replicated at COMMIT PREPARED. pg_createsubscriber: hint: You can use the command-line option --enable-two-phase to enable two_phase. pg_createsubscriber: warning: required WAL could be removed from the publisher pg_createsubscriber: hint: Set the configuration parameter "max_slot_wal_keep_size" to -1 to ensure that required WAL files are not prematurely removed. pg_createsubscriber: stopping the subscriber 2025-10-03 14:20:42.044 IST [1586103] LOG: received fast shutdown request 2025-10-03 14:20:42.048 IST [1586103] LOG: aborting any active transactions 2025-10-03 14:20:42.048 IST [1586110] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:20:42.055 IST [1586107] LOG: shutting down 2025-10-03 14:20:42.072 IST [1586103] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: creating publication "pub2" in database "db2" pg_createsubscriber: create publication "pub2" in database "db2" pg_createsubscriber: creating the replication slot "pg_createsubscriber_16386_11bc173d" in database "db2" pg_createsubscriber: create replication slot "pg_createsubscriber_16386_11bc173d" on publisher pg_createsubscriber: starting the subscriber 2025-10-03 14:20:42.191 IST [1586122] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:20:42.193 IST [1586122] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:20:42.207 IST [1586128] LOG: database system was shut down in recovery at 2025-10-03 14:20:42 IST 2025-10-03 14:20:42.208 IST [1586128] LOG: entering standby mode 2025-10-03 14:20:42.212 IST [1586128] LOG: redo starts at 0/03000028 2025-10-03 14:20:42.212 IST [1586128] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:20:42.212 IST [1586122] LOG: database system is ready to accept read-only connections 2025-10-03 14:20:42.218 IST [1586129] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: waiting for the target server to reach the consistent state pg_createsubscriber: target server reached the consistent state pg_createsubscriber: hint: If pg_createsubscriber fails after this point, you must recreate the physical replica before continuing. pg_createsubscriber: dropping publication "pub2" in database "db2" pg_createsubscriber: creating subscription "pg_createsubscriber_16386_11bc173d" in database "db2" pg_createsubscriber: setting the replication progress (node name "pg_0", LSN 0/00000000) in database "db2" pg_createsubscriber: enabling subscription "pg_createsubscriber_16386_11bc173d" in database "db2" pg_createsubscriber: stopping the subscriber 2025-10-03 14:20:42.331 IST [1586122] LOG: received fast shutdown request 2025-10-03 14:20:42.334 IST [1586122] LOG: aborting any active transactions 2025-10-03 14:20:42.334 IST [1586129] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:20:42.342 IST [1586126] LOG: shutting down 2025-10-03 14:20:42.356 IST [1586122] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: modifying system identifier of subscriber pg_createsubscriber: system identifier is 7556915253080212397 on subscriber pg_createsubscriber: running pg_resetwal on the subscriber pg_createsubscriber: Done! 3. Command: ./pg_createsubscriber -D standby/ -P "host=localhost port=5432 dbname=postgres" -d db1 --publication pub1 --clean=publications --dry-run --verbose Output: shubham@shubham-Virtual-Machine:~/Project/Git/postgres/inst/bin$ sh test_script.sh The files belonging to this database system will be owned by user "shubham". This user must also own the server process. The database cluster will be initialized with locale "en_IN". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are enabled. creating directory data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default "max_connections" ... 20 selecting default "shared_buffers" ... 400kB selecting default time zone ... Asia/Kolkata creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D data -l logfile start waiting for server to start.... done server started CREATE ROLE slot_name | lsn -----------+------------ replica_1 | 0/018ED790 (1 row) waiting for server to shut down.... done server stopped waiting for server to start.... done server started CREATE DATABASE CREATE DATABASE CREATE TABLE CREATE TABLE CREATE TABLE CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION 37878/37878 kB (100%), 1/1 tablespace waiting for server to start.... done server started ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM waiting for server to shut down.... done server stopped pg_createsubscriber: validating publisher connection string pg_createsubscriber: validating subscriber connection string pg_createsubscriber: checking if directory "standby" is a cluster data directory pg_createsubscriber: getting system identifier from publisher pg_createsubscriber: system identifier is 7556915544679711769 on publisher pg_createsubscriber: getting system identifier from subscriber pg_createsubscriber: system identifier is 7556915544679711769 on subscriber pg_createsubscriber: starting the standby server with command-line options 2025-10-03 14:22:04.944 IST [1586294] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:22:04.946 IST [1586294] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:22:04.960 IST [1586300] LOG: database system was shut down in recovery at 2025-10-03 14:22:03 IST 2025-10-03 14:22:04.961 IST [1586300] LOG: entering standby mode 2025-10-03 14:22:04.965 IST [1586300] LOG: redo starts at 0/03000028 2025-10-03 14:22:04.965 IST [1586300] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:22:04.966 IST [1586294] LOG: database system is ready to accept read-only connections 2025-10-03 14:22:04.973 IST [1586301] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: checking settings on subscriber pg_createsubscriber: checking settings on publisher pg_createsubscriber: warning: two_phase option will not be enabled for replication slots pg_createsubscriber: detail: Subscriptions will be created with the two_phase option disabled. Prepared transactions will be replicated at COMMIT PREPARED. pg_createsubscriber: hint: You can use the command-line option --enable-two-phase to enable two_phase. pg_createsubscriber: warning: required WAL could be removed from the publisher pg_createsubscriber: hint: Set the configuration parameter "max_slot_wal_keep_size" to -1 to ensure that required WAL files are not prematurely removed. pg_createsubscriber: stopping the subscriber 2025-10-03 14:22:05.083 IST [1586294] LOG: received fast shutdown request 2025-10-03 14:22:05.089 IST [1586294] LOG: aborting any active transactions 2025-10-03 14:22:05.089 IST [1586301] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:22:05.095 IST [1586298] LOG: shutting down 2025-10-03 14:22:05.109 IST [1586294] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: use existing publication "pub1" in database "db1" pg_createsubscriber: creating the replication slot "pg_createsubscriber_16385_52e3a5a" in database "db1" pg_createsubscriber: create replication slot "pg_createsubscriber_16385_52e3a5a" on publisher pg_createsubscriber: starting the subscriber 2025-10-03 14:22:05.317 IST [1586313] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:22:05.323 IST [1586313] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:22:05.334 IST [1586319] LOG: database system was shut down in recovery at 2025-10-03 14:22:05 IST 2025-10-03 14:22:05.334 IST [1586319] LOG: entering standby mode 2025-10-03 14:22:05.339 IST [1586319] LOG: redo starts at 0/03000028 2025-10-03 14:22:05.339 IST [1586319] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:22:05.339 IST [1586313] LOG: database system is ready to accept read-only connections 2025-10-03 14:22:05.346 IST [1586320] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: waiting for the target server to reach the consistent state pg_createsubscriber: target server reached the consistent state pg_createsubscriber: hint: If pg_createsubscriber fails after this point, you must recreate the physical replica before continuing. pg_createsubscriber: dropping all existing publications in database "db1" pg_createsubscriber: dropping publication "pub1" in database "db1" pg_createsubscriber: dropping publication "pub2" in database "db1" pg_createsubscriber: dropping publication "pub3" in database "db1" pg_createsubscriber: dropping publication "pub4" in database "db1" pg_createsubscriber: creating subscription "pg_createsubscriber_16385_52e3a5a" in database "db1" pg_createsubscriber: setting the replication progress (node name "pg_0", LSN 0/00000000) in database "db1" pg_createsubscriber: enabling subscription "pg_createsubscriber_16385_52e3a5a" in database "db1" pg_createsubscriber: stopping the subscriber 2025-10-03 14:22:05.457 IST [1586313] LOG: received fast shutdown request 2025-10-03 14:22:05.461 IST [1586313] LOG: aborting any active transactions 2025-10-03 14:22:05.461 IST [1586320] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:22:05.463 IST [1586319] LOG: invalid record length at 0/04000228: expected at least 24, got 0 2025-10-03 14:22:05.466 IST [1586317] LOG: shutting down 2025-10-03 14:22:05.481 IST [1586313] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: modifying system identifier of subscriber pg_createsubscriber: system identifier is 7556915610088608876 on subscriber pg_createsubscriber: running pg_resetwal on the subscriber pg_createsubscriber: Done! 4. Command: ./pg_createsubscriber -D standby/ -P "host=localhost port=5432 dbname=postgres" -d db1 --publication pub1 --dry-run --verbose Output: shubham@shubham-Virtual-Machine:~/Project/Git/postgres/inst/bin$ sh test_script.sh The files belonging to this database system will be owned by user "shubham". This user must also own the server process. The database cluster will be initialized with locale "en_IN". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are enabled. creating directory data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default "max_connections" ... 20 selecting default "shared_buffers" ... 400kB selecting default time zone ... Asia/Kolkata creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D data -l logfile start waiting for server to start.... done server started CREATE ROLE slot_name | lsn -----------+------------ replica_1 | 0/018ED790 (1 row) waiting for server to shut down.... done server stopped waiting for server to start.... done server started CREATE DATABASE CREATE DATABASE CREATE TABLE CREATE TABLE CREATE TABLE CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION 37878/37878 kB (100%), 1/1 tablespace waiting for server to start.... done server started ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM waiting for server to shut down.... done server stopped pg_createsubscriber: validating publisher connection string pg_createsubscriber: validating subscriber connection string pg_createsubscriber: checking if directory "standby" is a cluster data directory pg_createsubscriber: getting system identifier from publisher pg_createsubscriber: system identifier is 7556915744664904916 on publisher pg_createsubscriber: getting system identifier from subscriber pg_createsubscriber: system identifier is 7556915744664904916 on subscriber pg_createsubscriber: starting the standby server with command-line options 2025-10-03 14:22:51.639 IST [1586481] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:22:51.641 IST [1586481] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:22:51.656 IST [1586487] LOG: database system was shut down in recovery at 2025-10-03 14:22:50 IST 2025-10-03 14:22:51.656 IST [1586487] LOG: entering standby mode 2025-10-03 14:22:51.662 IST [1586487] LOG: redo starts at 0/03000028 2025-10-03 14:22:51.662 IST [1586487] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:22:51.662 IST [1586481] LOG: database system is ready to accept read-only connections 2025-10-03 14:22:51.669 IST [1586488] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: checking settings on subscriber pg_createsubscriber: checking settings on publisher pg_createsubscriber: warning: two_phase option will not be enabled for replication slots pg_createsubscriber: detail: Subscriptions will be created with the two_phase option disabled. Prepared transactions will be replicated at COMMIT PREPARED. pg_createsubscriber: hint: You can use the command-line option --enable-two-phase to enable two_phase. pg_createsubscriber: warning: required WAL could be removed from the publisher pg_createsubscriber: hint: Set the configuration parameter "max_slot_wal_keep_size" to -1 to ensure that required WAL files are not prematurely removed. pg_createsubscriber: stopping the subscriber 2025-10-03 14:22:51.777 IST [1586481] LOG: received fast shutdown request 2025-10-03 14:22:51.782 IST [1586481] LOG: aborting any active transactions 2025-10-03 14:22:51.783 IST [1586488] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:22:51.788 IST [1586485] LOG: shutting down 2025-10-03 14:22:51.804 IST [1586481] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: use existing publication "pub1" in database "db1" pg_createsubscriber: creating the replication slot "pg_createsubscriber_16385_55490a8e" in database "db1" pg_createsubscriber: create replication slot "pg_createsubscriber_16385_55490a8e" on publisher pg_createsubscriber: starting the subscriber 2025-10-03 14:22:52.044 IST [1586500] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:22:52.046 IST [1586500] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:22:52.059 IST [1586506] LOG: database system was shut down in recovery at 2025-10-03 14:22:51 IST 2025-10-03 14:22:52.059 IST [1586506] LOG: entering standby mode 2025-10-03 14:22:52.063 IST [1586506] LOG: redo starts at 0/03000028 2025-10-03 14:22:52.064 IST [1586506] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:22:52.064 IST [1586500] LOG: database system is ready to accept read-only connections 2025-10-03 14:22:52.072 IST [1586507] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: waiting for the target server to reach the consistent state pg_createsubscriber: target server reached the consistent state pg_createsubscriber: hint: If pg_createsubscriber fails after this point, you must recreate the physical replica before continuing. pg_createsubscriber: preserve existing publication "pub1" in database "db1" pg_createsubscriber: creating subscription "pg_createsubscriber_16385_55490a8e" in database "db1" pg_createsubscriber: setting the replication progress (node name "pg_0", LSN 0/00000000) in database "db1" pg_createsubscriber: enabling subscription "pg_createsubscriber_16385_55490a8e" in database "db1" pg_createsubscriber: stopping the subscriber 2025-10-03 14:22:52.191 IST [1586500] LOG: received fast shutdown request 2025-10-03 14:22:52.195 IST [1586500] LOG: aborting any active transactions 2025-10-03 14:22:52.195 IST [1586507] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:22:52.200 IST [1586504] LOG: shutting down 2025-10-03 14:22:52.216 IST [1586500] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: modifying system identifier of subscriber pg_createsubscriber: system identifier is 7556915810852594983 on subscriber pg_createsubscriber: running pg_resetwal on the subscriber pg_createsubscriber: Done! 5. Command: ./pg_createsubscriber -D standby/ -P "host=localhost port=5432 dbname=postgres" --clean=publications --dry-run --verbose Output: shubham@shubham-Virtual-Machine:~/Project/Git/postgres/inst/bin$ sh test_script.sh The files belonging to this database system will be owned by user "shubham". This user must also own the server process. The database cluster will be initialized with locale "en_IN". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are enabled. creating directory data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default "max_connections" ... 20 selecting default "shared_buffers" ... 400kB selecting default time zone ... Asia/Kolkata creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D data -l logfile start waiting for server to start.... done server started CREATE ROLE slot_name | lsn -----------+------------ replica_1 | 0/018ED790 (1 row) waiting for server to shut down.... done server stopped waiting for server to start.... done server started CREATE DATABASE CREATE DATABASE CREATE TABLE CREATE TABLE CREATE TABLE CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION 37878/37878 kB (100%), 1/1 tablespace waiting for server to start.... done server started ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM waiting for server to shut down.... done server stopped pg_createsubscriber: validating publisher connection string pg_createsubscriber: validating subscriber connection string pg_createsubscriber: no database was specified pg_createsubscriber: database name "postgres" was extracted from the publisher connection string pg_createsubscriber: checking if directory "standby" is a cluster data directory pg_createsubscriber: getting system identifier from publisher pg_createsubscriber: system identifier is 7556915961586996622 on publisher pg_createsubscriber: getting system identifier from subscriber pg_createsubscriber: system identifier is 7556915961586996622 on subscriber pg_createsubscriber: starting the standby server with command-line options 2025-10-03 14:23:41.455 IST [1586667] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:23:41.460 IST [1586667] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:23:41.471 IST [1586673] LOG: database system was shut down in recovery at 2025-10-03 14:23:40 IST 2025-10-03 14:23:41.471 IST [1586673] LOG: entering standby mode 2025-10-03 14:23:41.477 IST [1586673] LOG: redo starts at 0/03000028 2025-10-03 14:23:41.477 IST [1586673] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:23:41.477 IST [1586667] LOG: database system is ready to accept read-only connections 2025-10-03 14:23:41.483 IST [1586674] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: checking settings on subscriber pg_createsubscriber: checking settings on publisher pg_createsubscriber: warning: two_phase option will not be enabled for replication slots pg_createsubscriber: detail: Subscriptions will be created with the two_phase option disabled. Prepared transactions will be replicated at COMMIT PREPARED. pg_createsubscriber: hint: You can use the command-line option --enable-two-phase to enable two_phase. pg_createsubscriber: warning: required WAL could be removed from the publisher pg_createsubscriber: hint: Set the configuration parameter "max_slot_wal_keep_size" to -1 to ensure that required WAL files are not prematurely removed. pg_createsubscriber: stopping the subscriber 2025-10-03 14:23:41.599 IST [1586667] LOG: received fast shutdown request 2025-10-03 14:23:41.603 IST [1586667] LOG: aborting any active transactions 2025-10-03 14:23:41.603 IST [1586674] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:23:41.610 IST [1586671] LOG: shutting down 2025-10-03 14:23:41.624 IST [1586667] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: creating publication "pg_createsubscriber_5_c2542c28" in database "postgres" pg_createsubscriber: create publication "pg_createsubscriber_5_c2542c28" in database "postgres" pg_createsubscriber: creating the replication slot "pg_createsubscriber_5_c2542c28" in database "postgres" pg_createsubscriber: create replication slot "pg_createsubscriber_5_c2542c28" on publisher pg_createsubscriber: starting the subscriber 2025-10-03 14:23:41.748 IST [1586686] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:23:41.751 IST [1586686] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:23:41.767 IST [1586692] LOG: database system was shut down in recovery at 2025-10-03 14:23:41 IST 2025-10-03 14:23:41.770 IST [1586692] LOG: entering standby mode 2025-10-03 14:23:41.785 IST [1586692] LOG: redo starts at 0/03000028 2025-10-03 14:23:41.785 IST [1586692] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:23:41.785 IST [1586686] LOG: database system is ready to accept read-only connections 2025-10-03 14:23:41.797 IST [1586693] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: waiting for the target server to reach the consistent state pg_createsubscriber: target server reached the consistent state pg_createsubscriber: hint: If pg_createsubscriber fails after this point, you must recreate the physical replica before continuing. pg_createsubscriber: dropping all existing publications in database "postgres" pg_createsubscriber: dropping publication "pg_createsubscriber_5_c2542c28" in database "postgres" pg_createsubscriber: creating subscription "pg_createsubscriber_5_c2542c28" in database "postgres" pg_createsubscriber: setting the replication progress (node name "pg_0", LSN 0/00000000) in database "postgres" pg_createsubscriber: enabling subscription "pg_createsubscriber_5_c2542c28" in database "postgres" pg_createsubscriber: stopping the subscriber 2025-10-03 14:23:41.889 IST [1586686] LOG: received fast shutdown request 2025-10-03 14:23:41.893 IST [1586686] LOG: aborting any active transactions 2025-10-03 14:23:41.894 IST [1586693] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:23:41.900 IST [1586690] LOG: shutting down 2025-10-03 14:23:41.913 IST [1586686] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: modifying system identifier of subscriber pg_createsubscriber: system identifier is 7556916024166639073 on subscriber pg_createsubscriber: running pg_resetwal on the subscriber pg_createsubscriber: Done! 6. Command: ./pg_createsubscriber -D standby/ -P "host=localhost port=5432 dbname=postgres" --dry-run --verbose Output: shubham@shubham-Virtual-Machine:~/Project/Git/postgres/inst/bin$ sh test_script.sh The files belonging to this database system will be owned by user "shubham". This user must also own the server process. The database cluster will be initialized with locale "en_IN". The default database encoding has accordingly been set to "UTF8". The default text search configuration will be set to "english". Data page checksums are enabled. creating directory data ... ok creating subdirectories ... ok selecting dynamic shared memory implementation ... posix selecting default "max_connections" ... 20 selecting default "shared_buffers" ... 400kB selecting default time zone ... Asia/Kolkata creating configuration files ... ok running bootstrap script ... ok performing post-bootstrap initialization ... ok syncing data to disk ... ok initdb: warning: enabling "trust" authentication for local connections initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D data -l logfile start waiting for server to start.... done server started CREATE ROLE slot_name | lsn -----------+------------ replica_1 | 0/018ED790 (1 row) waiting for server to shut down.... done server stopped waiting for server to start.... done server started CREATE DATABASE CREATE DATABASE CREATE TABLE CREATE TABLE CREATE TABLE CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION CREATE PUBLICATION 37878/37878 kB (100%), 1/1 tablespace waiting for server to start.... done server started ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM ALTER SYSTEM waiting for server to shut down.... done server stopped pg_createsubscriber: validating publisher connection string pg_createsubscriber: validating subscriber connection string pg_createsubscriber: no database was specified pg_createsubscriber: database name "postgres" was extracted from the publisher connection string pg_createsubscriber: checking if directory "standby" is a cluster data directory pg_createsubscriber: getting system identifier from publisher pg_createsubscriber: system identifier is 7556916270290454089 on publisher pg_createsubscriber: getting system identifier from subscriber pg_createsubscriber: system identifier is 7556916270290454089 on subscriber pg_createsubscriber: starting the standby server with command-line options 2025-10-03 14:24:53.236 IST [1586854] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:24:53.240 IST [1586854] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:24:53.251 IST [1586860] LOG: database system was shut down in recovery at 2025-10-03 14:24:52 IST 2025-10-03 14:24:53.251 IST [1586860] LOG: entering standby mode 2025-10-03 14:24:53.257 IST [1586860] LOG: redo starts at 0/03000028 2025-10-03 14:24:53.257 IST [1586860] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:24:53.257 IST [1586854] LOG: database system is ready to accept read-only connections 2025-10-03 14:24:53.263 IST [1586861] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: checking settings on subscriber pg_createsubscriber: checking settings on publisher pg_createsubscriber: warning: two_phase option will not be enabled for replication slots pg_createsubscriber: detail: Subscriptions will be created with the two_phase option disabled. Prepared transactions will be replicated at COMMIT PREPARED. pg_createsubscriber: hint: You can use the command-line option --enable-two-phase to enable two_phase. pg_createsubscriber: warning: required WAL could be removed from the publisher pg_createsubscriber: hint: Set the configuration parameter "max_slot_wal_keep_size" to -1 to ensure that required WAL files are not prematurely removed. pg_createsubscriber: stopping the subscriber 2025-10-03 14:24:53.377 IST [1586854] LOG: received fast shutdown request 2025-10-03 14:24:53.382 IST [1586854] LOG: aborting any active transactions 2025-10-03 14:24:53.382 IST [1586861] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:24:53.388 IST [1586858] LOG: shutting down 2025-10-03 14:24:53.402 IST [1586854] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: creating publication "pg_createsubscriber_5_f13abbd6" in database "postgres" pg_createsubscriber: create publication "pg_createsubscriber_5_f13abbd6" in database "postgres" pg_createsubscriber: creating the replication slot "pg_createsubscriber_5_f13abbd6" in database "postgres" pg_createsubscriber: create replication slot "pg_createsubscriber_5_f13abbd6" on publisher pg_createsubscriber: starting the subscriber 2025-10-03 14:24:53.525 IST [1586873] LOG: starting PostgreSQL 19devel on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit 2025-10-03 14:24:53.530 IST [1586873] LOG: listening on Unix socket "/home/shubham/Project/Git/postgres/inst/bin/.s.PGSQL.50432" 2025-10-03 14:24:53.543 IST [1586879] LOG: database system was shut down in recovery at 2025-10-03 14:24:53 IST 2025-10-03 14:24:53.545 IST [1586879] LOG: entering standby mode 2025-10-03 14:24:53.548 IST [1586879] LOG: redo starts at 0/03000028 2025-10-03 14:24:53.548 IST [1586879] LOG: consistent recovery state reached at 0/04000000 2025-10-03 14:24:53.549 IST [1586873] LOG: database system is ready to accept read-only connections 2025-10-03 14:24:53.554 IST [1586880] LOG: started streaming WAL from primary at 0/04000000 on timeline 1 pg_createsubscriber: server was started pg_createsubscriber: waiting for the target server to reach the consistent state pg_createsubscriber: target server reached the consistent state pg_createsubscriber: hint: If pg_createsubscriber fails after this point, you must recreate the physical replica before continuing. pg_createsubscriber: dropping publication "pg_createsubscriber_5_f13abbd6" in database "postgres" pg_createsubscriber: creating subscription "pg_createsubscriber_5_f13abbd6" in database "postgres" pg_createsubscriber: setting the replication progress (node name "pg_0", LSN 0/00000000) in database "postgres" pg_createsubscriber: enabling subscription "pg_createsubscriber_5_f13abbd6" in database "postgres" pg_createsubscriber: stopping the subscriber 2025-10-03 14:24:53.668 IST [1586873] LOG: received fast shutdown request 2025-10-03 14:24:53.671 IST [1586873] LOG: aborting any active transactions 2025-10-03 14:24:53.671 IST [1586880] FATAL: terminating walreceiver process due to administrator command 2025-10-03 14:24:53.679 IST [1586877] LOG: shutting down 2025-10-03 14:24:53.691 IST [1586873] LOG: database system is shut down pg_createsubscriber: server was stopped pg_createsubscriber: modifying system identifier of subscriber pg_createsubscriber: system identifier is 7556916332497479324 on subscriber pg_createsubscriber: running pg_resetwal on the subscriber pg_createsubscriber: Done!