Re: Improve the error message for logical replication of regular column to generated column.

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Shubham Khanna <khannashubham1197(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Improve the error message for logical replication of regular column to generated column.
Date: 2024-11-25 20:55:01
Message-ID: CAHut+PsWX3rc0RYoh9LkoM6aBqcc_Ld2YMC0Ftb3yySQHr0zcg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 25, 2024 at 5:27 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Mon, Nov 25, 2024 at 8:50 AM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
> >
> > 5.
> > As I reported above (#2), I think it is better to check for empty BMS
> > in the caller because then the code is easier to read. Also, you need
> > to comment on which of these 2 errors will take precedence because if
> > there are simultaneous problems you are still only reporting one kind
> > of error at a time.
> >
> > SUGGESTION:
> > /*
> > * Report any missing or generated columns. Note, if there are both
> > * kinds then the 'missing' error takes precedence.
> > */
> > if (!bms_is_empty(missingatts))
> > logicalrep_report_missing_and_gen_attrs(remoterel, missingatts,
> > true);
> > if (!bms_is_empty(generatedattrs))
> > logicalrep_report_missing_and_gen_attrs(remoterel, generatedattrs,
> > false);
> >
>
> This and the proposed coding pattern by patch look odd to me. We
> should have a single call to logicalrep_report_missing_and_gen_attrs()
> and pass both missing and generated maps to the function. Then, let
> the function display the appropriate ERROR message.
>

Yes, that would be better.

======
Kind Regards,
Peter Smith.
Fujitsu Australia

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2024-11-25 20:55:08 Re: Self contradictory examining on rel's baserestrictinfo
Previous Message Devulapalli, Raghuveer 2024-11-25 20:54:48 RE: Proposal for Updating CRC32C with AVX-512 Algorithm.