Re: simplifying foreign key/RI checks

From: Amit Langote <amitlangote09(at)gmail(dot)com>
To: Zhihong Yu <zyu(at)yugabyte(dot)com>
Cc: Corey Huinker <corey(dot)huinker(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: simplifying foreign key/RI checks
Date: 2022-01-18 06:30:52
Message-ID: CA+HiwqEXXzqWa=RE90Ce2=R9B0vggFrvGZYrupVT3GeY-XXR-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for the review.

On Tue, Dec 21, 2021 at 5:54 PM Zhihong Yu <zyu(at)yugabyte(dot)com> wrote:
> Hi,
>
> + int lockflags = 0;
> + TM_Result test;
> +
> + lockflags = TUPLE_LOCK_FLAG_LOCK_UPDATE_IN_PROGRESS;
>
> The above assignment can be meged with the line where variable lockflags is declared.

Sure.

> + GetUserIdAndSecContext(&save_userid, &save_sec_context);
>
> save_userid -> saved_userid
> save_sec_context -> saved_sec_context

I agree that's better though I guess I had kept the names as they were
in other functions.

Fixed nevertheless.

> + * the transaction-snapshot mode. If we didn't push one already, do
>
> didn't push -> haven't pushed

Done.

> For ri_PerformCheck():
>
> + bool source_is_pk = true;
>
> It seems the value of source_is_pk doesn't change - the value true can be plugged into ri_ExtractValues() calls directly.

OK, done.

v13 is attached.

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

Attachment Content-Type Size
v13-0002-Avoid-using-SPI-for-some-RI-checks.patch application/octet-stream 40.0 KB
v13-0001-Add-isolation-tests-for-snapshot-behavior-in-ri_.patch application/octet-stream 6.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Julien Rouhaud 2022-01-18 06:32:13 Re: SQL/JSON: JSON_TABLE
Previous Message Julien Rouhaud 2022-01-18 06:26:31 Re: In-placre persistance change of a relation