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

From Zhihong Yu
Subject Re: simplifying foreign key/RI checks
Date
Msg-id CALNJ-vRooFqxeXABu8hDSgrC4pRtmXNP6SJqeOO+25y_ByaRYg@mail.gmail.com
Whole thread Raw
In response to Re: simplifying foreign key/RI checks  (Amit Langote <amitlangote09@gmail.com>)
Responses Re: simplifying foreign key/RI checks  (Amit Langote <amitlangote09@gmail.com>)
List pgsql-hackers


On Mon, Mar 14, 2022 at 1:33 AM Amit Langote <amitlangote09@gmail.com> wrote:
On Tue, Jan 18, 2022 at 3:30 PM Amit Langote <amitlangote09@gmail.com> wrote:
> v13 is attached.

I noticed that the recent 641f3dffcdf's changes to
get_constraint_index() made it basically unusable for this patch's
purposes.

Reading in the thread that led to 641f3dffcdf why
get_constraint_index() was changed the way it was, I invented in the
attached updated patch a get_fkey_constraint_index() that is local to
ri_triggers.c for use by the new ri_ReferencedKeyExists(), replacing
get_constraint_index() that no longer gives it the index it's looking
for.

--
Amit Langote
EDB: http://www.enterprisedb.com
Hi,
+                   partkey_isnull[j] = (key_nulls[k] == 'n' ? true : false); 

The above can be shortened as:

  partkey_isnull[j] = key_nulls[k] == 'n';

+        * May neeed to cast each of the individual values of the foreign key

neeed -> need

Cheers

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: On login trigger: take three
Next
From: Nitin Jadhav
Date:
Subject: Re: Report checkpoint progress with pg_stat_progress_checkpoint (was: Report checkpoint progress in server logs)