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

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: "Bharath Rupireddy" <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, "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-10 12:17:54
Message-ID: 098677b5-b910-4e16-9956-bfb953837ed0@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

--
Euler Taveira
EDB https://www.enterprisedb.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Georgios 2021-03-10 12:23:30 Re: Allow batched insert during cross-partition updates
Previous Message Dilip Kumar 2021-03-10 11:51:45 Re: [HACKERS] Custom compression methods