Re: Assert failure of the cross-check for nullingrels

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Assert failure of the cross-check for nullingrels
Date: 2023-05-17 19:34:54
Message-ID: 3563470.1684352094@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> Here is an updated patch with comments and test case. I also change the
> code to store 'group_clause_relids' directly in RestrictInfo.

Hmm ... I don't like this patch terribly much. It's not obvious why
(or if) it works, and it's squirreling bits of semantic knowledge
into places they don't belong. ISTM the fundamental problem is that
clause_is_computable_at() is accepting clauses it shouldn't, and we
should try to solve it there.

After some poking at it I hit on what seems like a really simple
solution: we should be checking syn_righthand not min_righthand
to see whether a Var should be considered nullable by a given OJ.
Maybe that's still not quite right, but it seems like it might be
right given that the last fix reaffirmed our conviction that Vars
should be marked according to the syntactic structure.

If we don't want to do it like this, another way is to consider
the transitive closure of commutable outer joins, along similar
lines to your fixes to my earlier patch. But that seems like it
might just be adding complication.

regards, tom lane

Attachment Content-Type Size
v3-0001-fix-clause_is_computable_at.patch text/x-diff 2.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-05-17 19:42:37 Re: Assert failure of the cross-check for nullingrels
Previous Message Andres Freund 2023-05-17 19:34:48 Re: walsender performance regression due to logical decoding on standby changes