On Thu, Jun 12, 2025 at 6:56 PM Robert Haas <robertmh...@gmail.com> wrote: > > On Thu, Jun 12, 2025 at 3:09 AM Amit Kapila <amit.kapil...@gmail.com> wrote: > > cases like UPDATE_MISSING, DELETE_MISSING, the existing code > > ERRCODE_NO_DATA_FOUND seems to be an exact match. The LOG message > > appears when we don't find the row to be updated or deleted while > > applying changes. This can happen if someone deletes the required rows > > on the subscriber. This case is similar to unique_key_violation where > > we report ERRCODE_UNIQUE_VIOLATION when, during apply, we found the > > row with the same key exists (for example, cases like INSERT_EXISTS or > > UPDATE_EXISTS). So, I can't think of a reason to use a different > > error_code for these cases. > > Well, ERRCODE_NO_DATA_FOUND is "Class P0 - PL/pgSQL Error," and it > normally occurs when STRICT was used to say that SELECT INTO should > return exactly one row. This is a completely different part of the > system and a completely different situation. I see that one use of > ERRCODE_NO_DATA_FOUND has also found its way into tablecmds.c, but > that is probably also a mistake that should be fixed. >
Right, and I agree we should work on changing the use of error code ERRCODE_NO_DATA_FOUND in tablecmds.c. -- With Regards, Amit Kapila.