Re: Improve the error message for logical replication of regular column to generated column. - Mailing list pgsql-hackers

From vignesh C
Subject Re: Improve the error message for logical replication of regular column to generated column.
Date
Msg-id CALDaNm2Zi=hYt5fuGvyitT+CErvpP1f-U-jW7q-Z+d1Ty5tgcQ@mail.gmail.com
Whole thread Raw
In response to Re: Improve the error message for logical replication of regular column to generated column.  (Peter Smith <smithpb2250@gmail.com>)
List pgsql-hackers
On Mon, 18 Nov 2024 at 15:47, Shubham Khanna
<khannashubham1197@gmail.com> wrote:
>
> On Fri, Nov 15, 2024 at 7:07 PM vignesh C <vignesh21@gmail.com> wrote:
>
> I have fixed the given comments. The attached Patch contains the
> required changes.

Couple of minor comments:
1) Since the previous error is going to exit, this pfree is not required:
+               else
+                       ereport(ERROR,
+
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
+                                        errmsg_plural("cannot
replicate to target relation \"%s.%s\" generated column: %s",
+
"cannot replicate to target relation \"%s.%s\" generated columns: %s",
+                                                                  attcnt,
+
remoterel->nspname,
+
remoterel->relname,
+
attsbuf.data)));
+
+               pfree(attsbuf.data);


2) "You can add single-line comments such as 'Report missing columns'
and 'Report replicating to generated columns.'"
+               logicalrep_report_missing_and_gen_attrs(remoterel,
generatedattrs,
+
                         false);
+               logicalrep_report_missing_and_gen_attrs(remoterel, missingatts,
+
                         true);

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Parametrization minimum password lenght
Next
From: Peter Eisentraut
Date:
Subject: Re: CI CompilerWarnings test fails on 15 in mingw_cross_warning