On Wed, Jun 11, 2025 at 8:02 PM Dilip Kumar <dilipbal...@gmail.com> wrote: > > On Wed, Jun 11, 2025 at 7:33 PM Robert Haas <robertmh...@gmail.com> wrote: > > > > On Tue, Jun 10, 2025 at 2:09 AM Amit Kapila <amit.kapil...@gmail.com> wrote: > > > Can we instead try to use other suitable existing error codes? > > > > Why? > > > > I mean, I'm not 100% against using existing error codes, but I feel > > like we might be distorting the meanings of the existing error codes. > > If we used new error codes, then people could test for those and know > > that they would get exactly these conditions and nothing else. > > > > To enhance the clarity and specificity of our error reporting, > particularly for logical replication conflicts, I suggest we consider > defining a dedicated class of error codes, much like we have for FDWs. > IMHO this would be a more future-proof approach, given the potential > for many new conflict detection types in the future.
So here is my proposal for adding this new class of error codes and also the error codes as listed below. I have also changed the same in the patch. Let me know your thoughts? Section: Class LC - Logical replication conflict logging Error # (PostgreSQL-specific error class) LC001 E ERRCODE_L_R_APPLY_CONFLICT_UNIQUE_KEY_CONFLICT unique_key_conflict LC002 E ERRCODE_L_R_APPLY_CONFLICT_TARGET_ROW_MISSING target_row_missing LC003 E ERRCODE_L_R_APPLY_CONFLICT_ORIGIN_DIFFER target_row_origin_differ -- Regards, Dilip Kumar Google
v2-0001-Improve-error-codes-for-logical-replication-confl.patch
Description: Binary data