Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n9Ce0-0005Io-Qq for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Jan 2022 21:00:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n9Cdy-00048d-6F for pgsql-bugs@arkaria.postgresql.org; Sun, 16 Jan 2022 21:00:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n9Cdx-00048U-Ho for pgsql-bugs@lists.postgresql.org; Sun, 16 Jan 2022 21:00:53 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n9Cdr-00084l-3b for pgsql-bugs@lists.postgresql.org; Sun, 16 Jan 2022 21:00:51 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 20GL0iFi3820409; Sun, 16 Jan 2022 16:00:44 -0500 From: Tom Lane To: Peter Eisentraut cc: elprans@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17363: 14 regression: "could not identify a hash function for type record" in a nested record in sublink In-reply-to: <2998707.1642001695@sss.pgh.pa.us> References: <17363-f6d42fd0d726be02@postgresql.org> <2998707.1642001695@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 12 Jan 2022 10:34:55 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3820407.1642366844.1@sss.pgh.pa.us> Date: Sun, 16 Jan 2022 16:00:44 -0500 Message-ID: <3820408.1642366844@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > It appears that we're trying to use a hashed subplan for the =ANY, > where v13 did not. So I'm inclined to blame this on 01e658fa7 (Hash > support for row types). We backed off the optimism level a bit in > a3d2b1bbe (Disable anonymous record hash support except in special > cases), but evidently didn't go far enough; or else it's doing the > wrong thing for nested RECORD types. Ugh, found it: hash_ok_operator() is not accounting for this case. if (opid == ARRAY_EQ_OP) { /* array_eq is strict, but must check input type to ensure hashable */ /* XXX record_eq will need same treatment when it becomes hashable */ Node *leftarg = linitial(expr->args); return op_hashjoinable(opid, exprType(leftarg)); } Will fix. regards, tom lane