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: Daniel Gustafsson <daniel(at)yesql(dot)se>, vignesh C <vignesh21(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-11-13 03:00:10
Message-ID: CALj2ACWaQVNxXZAACLJa6NbvO-PZdkVXa238SCRTU2zXgXwVnA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Nov 13, 2021 at 12:06 AM Euler Taveira <euler(at)eulerto(dot)com> wrote:
> > Here's a rebased v8 patch. Please review it.
>
> This improves the user experience by increasing the granularity of error
> reporting, and maps well with the precedent set in 81d5995b4. I'm marking this
> Ready for Committer and will go ahead and apply this unless there are
> objections.
>
> Shouldn't we modify errdetail_relkind_not_supported() to include relpersistence
> as a 2nd parameter and move those messages to it? I experiment this idea with
> the attached patch. The idea is to provide a unique function that reports
> accurate detail messages.

Thanks. It is a good idea to use errdetail_relkind_not_supported. I
slightly modified the API to "int errdetail_relkind_not_supported(Oid
relid, Form_pg_class rd_rel);" to simplify things and increase the
usability of the function further. For instance, it can report the
specific error for the catalog tables as well. And, also added "int
errdetail_relkind_not_supported _v2(Oid relid, char relkind, char
relpersistence);" so that the callers not having Form_pg_class (there
are 3 callers exist) can pass the parameters directly.

PSA v10.

Regards,
Bharath Rupireddy.

Attachment Content-Type Size
v10-0001-Improve-publication-error-messages.patch application/x-patch 27.6 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Japin Li 2021-11-13 03:04:12 Inconsistent error message for varchar(n)
Previous Message Bharath Rupireddy 2021-11-13 02:59:52 Re: Allow users to choose what happens when recovery target is not reached