Re: error message when subscription target is a partitioned table

Amit Langote <langote_amit_f8@lab.ntt.co.jp>

From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Magnus Hagander <magnus@hagander.net>, Tatsuo Ishii <ishii@sraoss.co.jp>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-12-04T01:51:40Z
Lists: pgsql-hackers

Attachments

On 2018/12/03 17:51, Magnus Hagander wrote:
> On Mon, Dec 3, 2018 at 7:39 AM Tatsuo Ishii <ishii@sraoss.co.jp> wrote:
>>> Could we improve the error message that's output when the subscription
>>> target relation is a partitioned table?  Currently, we get:
>>>
>>> ERROR:  logical replication target relation "public.foo" is not a table
>>>
>>> I think it'd be more helpful to get:
>>>
>>> ERROR: "public.foo" is a partitioned table
>>> DETAIL: Partitioned tables are not supported as logical replication
>> targets
>>>
>>> Thoughts?
>>
>> +1
> 
> +1 as well. That is definitely confusing -- to most people, that is still a
> table...

Okay, here is a patch.  I didn't find any tests in subscription.sql
related to unsupported relkinds, so didn't bother adding one for this case
either.

Thanks,
Amit

Commits

  1. Improve error messages for incorrect types of logical replication targets