Re: Logical Replication - improve error message while adding tables to the publication in check_publication_add_relation

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Euler Taveira <euler(at)eulerto(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Logical Replication - improve error message while adding tables to the publication in check_publication_add_relation
Date: 2021-03-11 14:56:05
Message-ID: CALj2ACUY=pf=QkJ7x2vAT+9aDsSFUeSr1986s8PJcT8zHj1LUQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 10, 2021 at 5:48 PM Euler Taveira <euler(at)eulerto(dot)com> wrote:
>
> On Wed, Mar 10, 2021, at 2:14 AM, Bharath Rupireddy wrote:
>
> While providing thoughts on [1], I observed that the error messages
> that are emitted while adding foreign, temporary and unlogged tables
> can be improved a bit from the existing [2] to [3]. For instance, the
> existing message when foreign table is tried to add into the
> publication "f1" is not a table" looks odd. Because it says that the
> foreign table is not a table at all.
>
> I wouldn't mix [regular|partitioned|temporary|unlogged] tables with foreign
> tables. Although, they have a pg_class entry in common, foreign tables aren't
> "real" tables (external storage); they even have different DDLs to handle it
> (CREATE TABLE x CREATE FOREIGN TABLE).
>
> postgres=# CREATE PUBLICATION testpub FOR TABLE f1;
> ERROR: "f1" is not a table
> DETAIL: Only tables can be added to publications.
>
> I agree that "f1 is not a table" is a confusing message at first because
> foreign table has "table" as description. Maybe if we apply the negation in
> both messages it would be clear (using the same wording as system tables).
>
> ERROR: "f1" is a foreign table
> DETAIL: Foreign tables cannot be added to publications.

Thanks. Changed the error message and detail to the way we have it for
system tables presently. Attaching v2 patch for further review.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

Attachment Content-Type Size
v2-0001-Improve-error-message-while-adding-tables-to-publ.patch application/x-patch 6.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2021-03-11 14:57:58 Re: documentation fix for SET ROLE
Previous Message Hywel Carver 2021-03-11 14:39:55 Re: Self-join optimisation