Re: Pgoutput not capturing the generated columns

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Shubham Khanna <khannashubham1197(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Rajendra Kumar Dangwal <dangwalrajendra888(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, euler(at)eulerto(dot)com
Subject: Re: Pgoutput not capturing the generated columns
Date: 2024-10-29 15:20:15
Message-ID: CALDaNm1oVD6qNO9_kc9F0cjtb+smHqb-ZhLQU6eHo45ybyUWfg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 29 Oct 2024 at 17:09, Shubham Khanna
<khannashubham1197(at)gmail(dot)com> wrote:
>
> While performing the Backward Compatibility Test, I found that
> 'tablesync' is not working for the older versions i.e., from
> version-12 till version-15.
> I created 2 nodes ; PUBLISHER on old versions and SUBSCRIBER on HEAD +
> v45 Patch for testing.
> Following was done on the PUBLISHER node:
> CREATE TABLE t1 (c1 int, c2 int GENERATED ALWAYS AS (c1 * 2) STORED);
> INSERT INTO t1 (c1) VALUES (1), (2);
> CREATE PUBLICATION pub1 for table t1;
>
> Following was done on the SUBSCRIBER node:
> CREATE TABLE t1 (c1 int, c2 int);
> CREATE SUBSCRIPTION sub1 CONNECTION 'dbname=postgres' PUBLICATION pub1;
>
> Following Error occurs repeatedly in the Subscriber log files:
> ERROR: could not start initial contents copy for table "public.t1":
> ERROR: column "c2" is a generated column
> DETAIL: Generated columns cannot be used in COPY.

Thank you for reporting this issue. The attached v46 patch addresses
the problem and includes some adjustments to the comments. Thanks to
Amit for sharing the comment changes offline.

Regards,
Vignesh

Attachment Content-Type Size
v46-0001-Replicate-generated-columns-when-specified-in-th.patch text/x-patch 20.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2024-10-29 16:01:24 Scrollable cursors that use an nbtree index scan are subtly broken with array keys (bug affecting 17+)
Previous Message Nathan Bossart 2024-10-29 15:00:28 Re: Reduce one comparison in binaryheap's sift down