On Thu, Mar 11, 2021 at 8:26 PM Bharath Rupireddy <bharath.rupireddyforpostg...@gmail.com> wrote: > > On Wed, Mar 10, 2021 at 5:48 PM Euler Taveira <eu...@eulerto.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.
Here's the v3 patch rebased on the latest master. With Regards, Bharath Rupireddy. EnterpriseDB: http://www.enterprisedb.com
v3-0001-Improve-error-message-while-adding-tables-to-publ.patch
Description: Binary data