diff options
-rw-r--r-- | src/backend/replication/logical/worker.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/replication/logical/worker.c b/src/backend/replication/logical/worker.c index 6fd674b5d60..ef2a6beb361 100644 --- a/src/backend/replication/logical/worker.c +++ b/src/backend/replication/logical/worker.c @@ -4545,12 +4545,14 @@ ApplyWorkerMain(Datum main_arg) replorigin_session_setup(originid, 0); replorigin_session_origin = originid; origin_startpos = replorigin_session_get_progress(false); - CommitTransactionCommand(); /* Is the use of a password mandatory? */ must_use_password = MySubscription->passwordrequired && !superuser_arg(MySubscription->owner); + /* Note that the superuser_arg call can access the DB */ + CommitTransactionCommand(); + LogRepWorkerWalRcvConn = walrcv_connect(MySubscription->conninfo, true, must_use_password, MySubscription->name, &err); |