Re: simplifying foreign key/RI checks - Mailing list pgsql-hackers

From Amit Langote
Subject Re: simplifying foreign key/RI checks
Date
Msg-id CA+HiwqEWv1qLpONP_V-zwhYwOhXvwMYxsKLpo0nMr6=aMaMLsg@mail.gmail.com
Whole thread Raw
In response to Re: simplifying foreign key/RI checks  (Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>)
Responses Re: simplifying foreign key/RI checks  (Tatsuro Yamada <tatsuro.yamada.tf@nttcom.co.jp>)
List pgsql-hackers
Yamada-san,

On Wed, Jan 27, 2021 at 8:51 AM Tatsuro Yamada
<tatsuro.yamada.tf@nttcom.co.jp> wrote:
> On 2021/01/25 18:19, Amit Langote wrote:
> > On Mon, Jan 25, 2021 at 9:24 AM Corey Huinker <corey.huinker@gmail.com> wrote:
> >> Anybody else want to look this patch over before I mark it Ready For Committer?
> >
> > Would be nice to have others look it over.  Thanks.
>
> Thanks for creating the patch!
>
> I tried to review the patch. Here is my comment.

Thanks for the comment.

> * According to this thread [1], it might be better to replace elog() with
>    ereport() in the patch.
>
> [1]: https://www.postgresql.org/message-id/flat/92d6f545-5102-65d8-3c87-489f71ea0a37%40enterprisedb.com

Could you please tell which elog() of the following added by the patch
you are concerned about?

+           case TM_Invisible:
+               elog(ERROR, "attempted to lock invisible tuple");
+               break;
+
+           case TM_SelfModified:
+           case TM_BeingModified:
+           case TM_WouldBlock:
+               elog(ERROR, "unexpected table_tuple_lock status: %u", res);
+               break;

+           default:
+               elog(ERROR, "unrecognized table_tuple_lock status: %u", res);

All of these are meant as debugging elog()s for cases that won't
normally occur.  IIUC, the discussion at the linked thread excludes
those from consideration.


--
Amit Langote
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: fix typo in reorderbuffer.c
Next
From: Jaime Casanova
Date:
Subject: FailedAssertion in heap_index_delete_tuples at heapam.c:7220