RE: Pgoutput not capturing the generated columns

From: "Shinoda, Noriyoshi (SXD Japan FSI)" <noriyoshi(dot)shinoda(at)hpe(dot)com>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>, vignesh C <vignesh21(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, "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 13:02:33
Message-ID: DM4PR84MB1734F8F140E4477580761F93EEE02@DM4PR84MB1734.NAMPRD84.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi, hackers.

Thanks for developing this great feature.
The documentation for the pg_publication catalog shows a 'pubgencols' column, but the actual column name is the 'pubgencols_type' column.
Also, the order of the columns in the documentation differs from the order of the columns in the actual pg_publication catalog.
The attached patch changes the column names and order in the documentation.

Regards,
Noriyoshi Shinoda
-----Original Message-----
From: Daniel Gustafsson <daniel(at)yesql(dot)se>
Sent: Thursday, January 23, 2025 9:45 PM
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>; Peter Smith <smithpb2250(at)gmail(dot)com>; Michael Paquier <michael(at)paquier(dot)xyz>; Shinoda, Noriyoshi (SXD Japan FSI) <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; euler(at)eulerto(dot)com
Subject: Re: Pgoutput not capturing the generated columns

> On 23 Jan 2025, at 13:19, vignesh C <vignesh21(at)gmail(dot)com> wrote:

> When dumping from Postgres <=PG17 servers, the query generated for
> pubgencols_type incorrectly included the macro name instead of the
> macro value. This resulted in dump failures. This commit fixes the
> issue by correctly specifying the macro value in the query. The
> attached patch has the changes for the same.

I was just looking at the Xversion test failure on crake (which has the log entry below) when I saw your email.

pg_dump: error: query failed: ERROR: column "publish_gencols_none" does not exist LINE 1: ...elete, false AS pubtruncate, false AS pubviaroot, PUBLISH_GE...
^
pg_dump: detail: Query was: SELECT p.tableoid, p.oid, p.pubname, p.pubowner, p.puballtables, p.pubinsert, p.pubupdate, p.pubdelete, false AS pubtruncate, false AS pubviaroot, PUBLISH_GENCOLS_NONE AS pubgencols_type FROM pg_publication p
pg_dumpall: error: pg_dump failed on database "template1", exiting

Your patch seems like a reasonable fix.

--
Daniel Gustafsson

Attachment Content-Type Size
pg_publication_doc_v1.diff application/octet-stream 2.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Tatarintsev 2025-01-23 13:03:12 Re: create subscription with (origin = none, copy_data = on)
Previous Message Jelte Fennema-Nio 2025-01-23 12:57:07 New process of getting changes into the commitfest app