Re: [BUG] [PATCH] pg_basebackup produces wrong incremental files after relation truncation in segmented tables

Oleg Tkachenko <oatkachenko@gmail.com>

From: Oleg Tkachenko <oatkachenko@gmail.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Amul Sul <sulamul@gmail.com>, pgsql-hackers@lists.postgresql.org, Stanislav Bashkyrtsev <stanislav.bashkyrtsev@elsci.io>
Date: 2025-12-16T21:55:02Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Don't set the truncation block length greater than RELSEG_SIZE.

Hello, Robert

I’ve created a small test that reproduces the issue. With the proposed fix applied, the test passes, and the reconstruction behaves as expected.

I’m attaching the test for review. Please let me know if this looks OK or if you would like it changed.



Regards,

Oleg



> On Dec 15, 2025, at 21:13, Robert Haas <robertmhaas@gmail.com> wrote:
> 
> On Mon, Dec 15, 2025 at 1:46 PM Oleg Tkachenko <oatkachenko@gmail.com> wrote:
>> Also, I’ve attached a patch based on your guidance. The changes are effectively the same as your suggested approach, but I would be happy to be listed as a contributor.
> 
> You'll certain be listed as the reporter for this issue when a fix is
> committed. If you want to be listed as a co-author of the patch, I
> think it is fair to say that it will need to contain some code written
> by you. For example, maybe you would like to try writing a TAP test
> case that fails without this fix and passes with it.
> 
> -- 
> Robert Haas
> EDB: http://www.enterprisedb.com