Re: [Sender Address Forgery]Re: error message when subscriptiontarget is a partitioned table - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [Sender Address Forgery]Re: error message when subscriptiontarget is a partitioned table
Date
Msg-id 20190107073519.GE22498@paquier.xyz
Whole thread Raw
In response to Re: [Sender Address Forgery]Re: error message when subscriptiontarget is a partitioned table  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: [Sender Address Forgery]Re: error message when subscriptiontarget is a partitioned table  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On Mon, Jan 07, 2019 at 01:49:49PM +0900, Amit Langote wrote:
>  {
>      /*
> -     * We currently only support writing to regular tables.
> +     * We currently only support writing to regular tables.  However, give
> +     * a more specific error for partitioned and foreign tables.
>       */
> +    if (relkind == RELKIND_PARTITIONED_TABLE)
> +        ereport(ERROR,
> +                (errcode(ERRCODE_WRONG_OBJECT_TYPE),
> +                 errmsg("\"%s.%s\" is a partitioned table",
> +                        nspname, relname),
> +                 errdetail("Partitioned tables are not
> supported as logical replication targets.")));

Could it be possible to avoid a full sentence in the primary error
message?  Usually these are avoided:
https://www.postgresql.org/docs/devel/error-style-guide.html

It seems to me that we may want something more like:
Primary: "could not use \"%s.%s\" as logical replication target".
Detail: "Relation %s.%s is a foreign table", "not a table", etc.

The existing error message in CheckSubscriptionRelkind() could also be
better regarding that...
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: A few new options for vacuumdb
Next
From: Masahiko Sawada
Date:
Subject: Using logical replication with older version subscribers