Improve errhint for ALTER SUBSCRIPTION ADD/DROP PUBLICATION

Zhijie Hou (Fujitsu) <houzj.fnst@fujitsu.com>

From: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>
To: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2022-10-17T03:09:29Z
Lists: pgsql-hackers

Attachments

Hi,

While working on some logical replication related features.
I found the HINT message could be improved when I tried to add a publication to
a subscription which was disabled.

alter subscription sub add publication pub2;
--
ERROR: ALTER SUBSCRIPTION with refresh is not allowed for disabled subscriptions
HINT: Use ALTER SUBSCRIPTION ... SET PUBLICATION ... WITH (refresh = false).
--

Because I was executing the ADD PUBLICATION command, I feel the hint should
also mention it instead of SET PUBLICATION.

Best regards,
Hou zj


Commits

  1. Improve errhint for ALTER SUBSCRIPTION ADD/DROP PUBLICATION