Better error message for unsupported replication cases

Started by Tom Laneabout 4 years ago3 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

In [1]/messages/by-id/CANhtRiamAgYt1A-Nh4=mU3E1UhG9XPgB+X6mW1DWqa93vUXW9A@mail.gmail.com there's a complaint that if you try to logically replicate
a partitioned table from v13-or-later to v12-or-earlier, you get
"table XXX not found on publisher", which is pretty confusing
because the publisher certainly does have such a table. That
happens because fetch_remote_table_info is too aggressive about
filtering by relkind and doesn't see the relation at all.
c314c147c improved that, but it wasn't back-patched. I propose
putting the attached into v10-v12. Maybe the error message
could be bikeshedded ... is "non-table relation" terminology
that we use in user-facing messages?

regards, tom lane

[1]: /messages/by-id/CANhtRiamAgYt1A-Nh4=mU3E1UhG9XPgB+X6mW1DWqa93vUXW9A@mail.gmail.com

Attachments:

handle-unsupported-relkind-better.patchtext/x-diff; charset=us-ascii; name=handle-unsupported-relkind-better.patchDownload+17-4
#2Amit Kapila
amit.kapila16@gmail.com
In reply to: Tom Lane (#1)
Re: Better error message for unsupported replication cases

On Tue, Feb 15, 2022 at 3:42 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

In [1] there's a complaint that if you try to logically replicate
a partitioned table from v13-or-later to v12-or-earlier, you get
"table XXX not found on publisher", which is pretty confusing
because the publisher certainly does have such a table. That
happens because fetch_remote_table_info is too aggressive about
filtering by relkind and doesn't see the relation at all.
c314c147c improved that, but it wasn't back-patched. I propose
putting the attached into v10-v12. Maybe the error message
could be bikeshedded ... is "non-table relation" terminology
that we use in user-facing messages?

The other option could be "logical replication source relation
\"%s.%s\" is not a table". We use a similar message in
CheckSubscriptionRelkind.

--
With Regards,
Amit Kapila.

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Amit Kapila (#2)
Re: Better error message for unsupported replication cases

Amit Kapila <amit.kapila16@gmail.com> writes:

On Tue, Feb 15, 2022 at 3:42 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:

... Maybe the error message
could be bikeshedded ... is "non-table relation" terminology
that we use in user-facing messages?

The other option could be "logical replication source relation
\"%s.%s\" is not a table". We use a similar message in
CheckSubscriptionRelkind.

Works for me, I'll do it like that if there are no objections.

regards, tom lane