Re: Assert the timestamp is available for ORIGN_DIFFERS conflicts

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>
Subject: Re: Assert the timestamp is available for ORIGN_DIFFERS conflicts
Date: 2026-01-21 05:45:25
Message-ID: CAJpy0uBGUp0Tjspzj9t9Rs_zPVtQky-_H=wPd-JbOfjKFSrDJg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 21, 2026 at 10:52 AM Hayato Kuroda (Fujitsu)
<kuroda(dot)hayato(at)fujitsu(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2026-01-21 06:05:18 Re: Skipping schema changes in publication
Previous Message Chao Li 2026-01-21 05:29:30 Re: docs: clarify ALTER TABLE behavior on partitioned tables