pglogical
pglogical copied to clipboard
pglogical_create_subscriber and non-default ports
pglogical_create_subscriber
takes a --publisher-dsn
and a --subscriber-dsn
option where you can specify non-default ports if needed.
However, it seems to me that pglogical_create_subscriber
starts the subscriber postgres on the default port 5432 in pglogical_create_subscriber.c
around line 480:
pg_ctl_ret = run_pg_ctl("start -l \"pglogical_create_subscriber_postgres.log\" -o \"-c shared_preload_libraries=''\"");
Afterwards, I get a 5432 socket in the specified socketdir, the port=
from --subscriber-dsn
is not being honored.
I can pass a --postgresql-conf
where in theory I could change the port, but that one is for the publisher and is getting cloned via pg_basebackup
, so if both publisher and subscriber are on the same host (when testing e.g.) that would clash as well.
In particular, the t/010
TAP test seems to require a free 5432 port for the subscriber, which is often not the case on a test system.
As a work-around, I can add local $ENV{PGPORT} = 65432;
just before the pglogical_create_subscriber
command in the TAP test.
Am I missing something else here maybe?
The --postgresql-conf
is not for publisher, it's for the new node.