Re: Assert the timestamp is available for ORIGN_DIFFERS conflicts - Mailing list pgsql-hackers

From shveta malik
Subject Re: Assert the timestamp is available for ORIGN_DIFFERS conflicts
Date
Msg-id CAJpy0uBGUp0Tjspzj9t9Rs_zPVtQky-_H=wPd-JbOfjKFSrDJg@mail.gmail.com
Whole thread Raw
In response to Assert the timestamp is available for ORIGN_DIFFERS conflicts  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Responses RE: Assert the timestamp is available for ORIGN_DIFFERS conflicts
List pgsql-hackers
On Wed, Jan 21, 2026 at 10:52 AM Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
>
> Dear Hackers,
>
> This is a fork from [1].
>
> While constructing a conflict message, CT_UPDATE_ORIGIN_DIFFERS and
> CT_DELETE_ORIGIN_DIFFERS assumes that timestamp for the local commit is always
> available. Actually, it's valid because they can be detected only with
> track_commit_timestamp, but source code does not describe anything for it.
> PSA the patch to add Assert() or it.
>
> [1]:
https://www.postgresql.org/message-id/TY7PR01MB145540C10F511D9AF40CCB395F58DA%40TY7PR01MB14554.jpnprd01.prod.outlook.com
>

Looks good. Can we tweak the comment slightly?

Current:
+ /*
+ * This type of conflict can be detected only with enabling
+ * track_commit_timestamp.
+ */
+ Assert(localts);

Suggestion:
/*
 * We reach this point only if track_commit_timestamp is enabled.
 * Therefore, localts must contain a valid timestamp.
 */
or
/*
 * This type of conflict can be detected only when track_commit_timestamp
 * is enabled; therefore, the timestamp must be valid here.
 */

thanks
Shveta



pgsql-hackers by date:

Previous
From: Chao Li
Date:
Subject: Re: docs: clarify ALTER TABLE behavior on partitioned tables
Next
From: Dilip Kumar
Date:
Subject: Re: Skipping schema changes in publication