Re: BUG #17363: 14 regression: "could not identify a hash function for type record" in a nested record in sublink

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: elprans(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17363: 14 regression: "could not identify a hash function for type record" in a nested record in sublink
Date: 2022-01-16 21:00:44
Message-ID: 3820408.1642366844@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Etsuro Fujita 2022-01-18 08:01:27 Re: BUG #17355: Server crashes on ExecReScanForeignScan in postgres_fdw when accessing foreign partition
Previous Message Tom Lane 2022-01-16 16:43:14 Re: pg_upgrade --check doesn't check pg_pltemplate modifications