Re: create subscription - improved warning message - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: create subscription - improved warning message
Date
Msg-id CAA4eK1+z_=25DqsLfdP3e4KtrMAOd9yG7BVSv5W7iXu-RcAthA@mail.gmail.com
Whole thread Raw
In response to Re: create subscription - improved warning message  (Peter Smith <smithpb2250@gmail.com>)
Responses Re: create subscription - improved warning message  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Mon, Oct 10, 2022 at 4:40 AM Peter Smith <smithpb2250@gmail.com> wrote:
>
> But if it's OK to do that then:
> - maybe it should mention the connection since the connect=false was
> what caused this warning.
> - maybe saying 'replication' instead of 'collection of data' would be
> more consistent with the pgdocs for CREATE SUBSCRIPTION
>
> e.g.
>
> WARNING: subscription was created, but is not connected
> HINT: You should run %s to initiate replication.
>

Yeah, this message looks better than the current one. However, when I
tried to do what HINT says, it doesn't initiate replication. It gives
me the below error:

postgres=# Alter subscription sub1 refresh publication;
ERROR:  ALTER SUBSCRIPTION ... REFRESH is not allowed for disabled subscriptions

Then, I enabled the subscription and again tried as below:
postgres=# Alter subscription sub1 enable;
ALTER SUBSCRIPTION
postgres=# Alter subscription sub1 refresh publication;
ALTER SUBSCRIPTION

Even after the above replication is not initiated. I see "ERROR:
replication slot "sub1" does not exist" in subscriber logs. Then, I
manually created this slot (by using
pg_create_logical_replication_slot) on the publisher. After that,
replication started to work.

If I am not missing something, don't you think we need a somewhat more
elaborative HINT, or may be just give the WARNING?

-- 
With Regards,
Amit Kapila.



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: ps command does not show walsender's connected db
Next
From: Tom Lane
Date:
Subject: Re: create subscription - improved warning message