Re: Assert failure of the cross-check for nullingrels
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Richard Guo <guofenglinux@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2023-05-17T19:34:54Z
Lists: pgsql-hackers
Attachments
- v3-0001-fix-clause_is_computable_at.patch (text/x-diff) patch v3-0001
Richard Guo <guofenglinux@gmail.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
Commits
-
In clause_is_computable_at(), test required_relids for clone clauses.
- b9c755a2f625 16.0 landed
-
Tweak API of new function clause_is_computable_at().
- 8a2523ff3540 16.0 landed