Re: Question on error code selection in conflict detection - Mailing list pgsql-hackers

From Robert Haas
Subject Re: Question on error code selection in conflict detection
Date
Msg-id CA+TgmoaoWmD3pkgaO7BJCpfEOrvDz6trfT27DmUaQpEJ26ktCw@mail.gmail.com
Whole thread Raw
In response to Question on error code selection in conflict detection  (Dilip Kumar <dilipbalaut@gmail.com>)
Responses Re: Question on error code selection in conflict detection
List pgsql-hackers
On Mon, Jun 9, 2025 at 9:45 AM Dilip Kumar <dilipbalaut@gmail.com> wrote:
> I was reviewing the code for conflict reporting and became curious
> about the choice of ERRCODE_T_R_SERIALIZATION_FAILURE. This error code
> typically signifies a serialization failure within a transaction under
> serializable isolation, so its use here for a different type of
> conflict seems somewhat out of place. I did notice its use in other
> contexts for recovery conflicts in physical replication, which also
> struck me as a bit unusual.
>
> Given these observations, I'm wondering if it would be more
> appropriate to introduce a new, more specific error code for this
> purpose?

Makes sense to me. I'm not sure if we should use a new error code or
some other existing one, but conflating other things with serializable
failures seems like a bad plan.

--
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Jesper Pedersen
Date:
Subject: Re: pg_rewind: Doc update for PostgreSQL 18
Next
From: Dimitrios Apostolou
Date:
Subject: Re: [PING] [PATCH v2] parallel pg_restore: avoid disk seeks when jumping short distance forward