Re: Pgoutput not capturing the generated columns

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, "Shinoda, Noriyoshi (SXD Japan FSIP)" <noriyoshi(dot)shinoda(at)hpe(dot)com>, Shubham Khanna <khannashubham1197(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" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "euler(at)eulerto(dot)com" <euler(at)eulerto(dot)com>
Subject: Re: Pgoutput not capturing the generated columns
Date: 2025-01-23 03:53:29
Message-ID: CAA4eK1LYNm7-=n66_0E18JD_11FsH4d=5XviO39KnGLk3PxrkA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 22, 2025 at 7:22 PM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>
> On 21.01.25 09:27, vignesh C wrote:
> >> Maybe I have some fundamental misunderstanding here, but I don't see
> >> why "this approach cannot be used with psql because older version
> >> servers may not have these columns". Not having the columns is the
> >> whole point of using an alias approach in the first place e.g. the
> >> below table t1 does not have a column called "banana" but it works
> >> just fine to select an alias using that name...
> >
> > This is simpler than maintaining the indexes. I misunderstood your
> > comment to include displaying the columns for older versions, I did
> > not want to display a value for the older versions as these columns do
> > not exist. I have updated the patch based on the alias approach. The
> > attached patch has the changes for the same.
>
> The v54-0004 patch looks ok to me.
>

Thanks for the review.

> I will wait until that gets committed before moving forward with the
> virtual generated columns patch.
>

Noted.

>
> A few quick comments on the v54-0005 patch (the documentation one):
>
> +<programlisting>
> +test_pub=# CREATE TABLE tab_gen_to_gen (a int, b int GENERATED ALWAYS
> AS (a + 1) STORED);
>
> I don't like when examples include the prompt like this. Then it's
> harder to copy the commands out of the examples.
>

One point to consider in this context is that examples need to perform
the same or similar commands on pub/sub, so the above prompt can help
in distinguishing the same though it is not necessary. Another thing
is that we have already used prompt style in other examples on the
logical replication page. For example, see "29.2.2. Examples: Set Up
Logical Replication" [1]. We may want to change those places
(separately) if we don't want to use prompt style here.

[1] - https://www.postgresql.org/docs/devel/logical-replication-subscription.html

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Keisuke Kuroda 2025-01-23 04:19:29 Re: Separate GUC for replication origins
Previous Message Peter Smith 2025-01-23 03:48:41 Re: Pgoutput not capturing the generated columns