Re: [PATCH v1] Fix initial sync of zero-column published tables

From: Mingjie Gao <mingjie(dot)gmj(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: Peter Smith <smithpb2250(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH v1] Fix initial sync of zero-column published tables
Date: 2026-11-07 06:13:16
Message-ID: CAL5_ZS2rEL1z_5bSKF+Aa-LbQDDGXOYVQztGZpJR9SLeW=q94w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Peter, Vignesh,

Thanks for the review. Attached is v3, based on the same master commit:
77705d1e5a616339c3e92f586bbfa7b6bb562beb.

Vignesh wrote:
> 1) Can we create the table in publisher and subscriber outside the
> loop instead of doing it twice, similarly the publication can be
> created outside the loop:

Done.

> 2) With the first changes, we can truncate the tables instead of dropping them:

Done. The subscription is dropped before truncating the tables between
modes. Each mode still checks initial sync and an incremental insert.

Peter wrote:
> Saying publish = 'insert' seems overkill.

Removed.

> Those could be combined a bit...

I've combined the cleanup and tidied the comments, spacing and
semicolons as suggested in your attachment. The C code is unchanged
from v2.

Vignesh wrote:
> 3) Till which branch will this patch be applied?

I reproduced the text-mode issue on PG10. I haven't reproduced it on
the other versions, but the code appears to have the same problem.
The binary case appears to be affected from PG16, which added binary
initial sync.

I think we should backpatch to the affected supported branches. I have
only tested the patch on master so far.

I tested v3 on master with assertions enabled. The regression tests and
the relevant logical replication tests passed.

Best regards,
mingjiegao

Attachment Content-Type Size
v3-0001-Fix-initial-sync-of-zero-column-published-tables.patch text/x-patch 7.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tender Wang 2026-11-07 06:15:05 Re: Wrong results with references to JOIN USING aliases
Previous Message Tom Lane 2026-11-07 02:51:06 Re: Wrong results with references to JOIN USING aliases