From: | vignesh C <vignesh21(at)gmail(dot)com> |
---|---|
To: | Peter Smith <smithpb2250(at)gmail(dot)com> |
Cc: | Amit Kapila <amit(dot)kapila16(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 04:28:09 |
Message-ID: | CALDaNm0h3djRkU17F8HOV+P+p0m0TyLGr111e3Axc9Y-KQ6cPg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Thu, 23 Jan 2025 at 05:52, Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> Some review comments for patch v54-0004.
>
> (since preparing this post, I saw you have already posted v55-0001 but
> AFAIK, since 55-0001 is just a merge, the same review comments are
> still applicable)
>
> ======
> doc/src/sgml/catalogs.sgml
>
> 1.
> <para>
> - If true, this publication replicates the stored generated columns
> - present in the tables associated with the publication.
> + <literal>n</literal> indicates that the generated columns in the tables
> + associated with the publication should not be replicated.
> + <literal>s</literal> indicates that the stored generated columns in the
> + tables associated with the publication should be replicated.
> </para></entry>
>
> It looks OK, but maybe we should use a wording style similar to that
> used already for pg_subscription.substream?
>
> Also, should this mention column lists?
>
> SUGGESTION
> Indicates how to handle generated column replication (when there is no
> publication column list): <literal>n</literal> = generated columns in
> the tables associated with the publication should not be replicated;
> <literal>s</literal> = stored generated columns in the tables
> associated with the publication should be replicated.
>
> ======
> src/backend/commands/publicationcmds.c
>
> parse_publication_options:
>
> 2.
> bool *publish_generated_columns_given,
> - bool *publish_generated_columns)
> + char *publish_generated_columns)
>
> Why not use the PublishGencolsType enum here?
>
> ~~~
>
> CreatePublication:
>
> 3.
> - bool publish_generated_columns;
> + char publish_generated_columns;
> AclResult aclresult;
>
> Why not use the PublishGencolsType enum here?
>
> ~~~
>
> AlterPublicationOptions:
>
> 4.
> bool publish_generated_columns_given;
> - bool publish_generated_columns;
> + char publish_generated_columns;
>
> Why not use the PublishGencolsType enum here?
>
> ~~~
>
> defGetGeneratedColsOption::
>
> 5.
> +/*
> + * Extract the publish_generated_columns option value from a DefElem. "stored"
> + * and "none" values are accepted.
> + */
> +static char
> +defGetGeneratedColsOption(DefElem *def)
> +{
>
> The return type should be PublishGencolsType.
>
> ======
> src/include/catalog/pg_publication.h
>
> 6.
> - /* true if generated columns data should be published */
> - bool pubgencols;
> + /*
> + * none if generated column data should not be published. stored if stored
> + * generated column data should be published.
> + */
> + char pubgencols_type;
> } FormData_pg_publication;
>
>
> Maybe this was accidentally changed by some global replacement you
> did. IMO the previous (v53) version comment was better here.
>
> - bool pubgencols;
> + /*
> + * 'n'(none) if generated column data should not be published.
> + * 's'(stored) if stored generated column data should be published.
> + */
Thanks for the comments, the attached v56 version patch has the fixes
for the above comments. v56-0002 is the same as the patch posted at
[1].
[1] - https://www.postgresql.org/message-id/CAHut%2BPuD7_yh54z-sGyK9xBq9cwUeJUG0BRQaHOhCLdw8msnjQ%40mail.gmail.com
Regards,
Vignesh
Attachment | Content-Type | Size |
---|---|---|
v56-0001-Change-publish_generated_columns-option-to-use-e.patch | text/x-patch | 95.3 KB |
v56-0002-DOCS-Generated-Column-Replication.patch | text/x-patch | 12.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2025-01-23 04:29:02 | Re: AIO v2.3 |
Previous Message | Tatsuo Ishii | 2025-01-23 04:25:02 | Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options |