Re: "type with xxxx does not exist" when doing ExecMemoize()

Andrei Lepikhov <a.lepikhov@postgrespro.ru>

From: Andrei Lepikhov <a.lepikhov@postgrespro.ru>
To: Tender Wang <tndrwang@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2024-02-26T02:52:59Z
Lists: pgsql-bugs, pgsql-hackers
On 25/2/2024 20:32, Tender Wang wrote:
> I think in prepare_probe_slot(), should called datumCopy as the attached 
> patch does.
> 
> Any thoughts? Thanks.
Thanks for the report.
I think it is better to invent a Runtime Memory Context; likewise, it is 
already designed in IndexScan and derivatives. Here, you just allocate 
the value in some upper memory context.
Also, I'm curious why such a trivial error hasn't been found for a long time

-- 
regards,
Andrei Lepikhov
Postgres Professional




Commits

  1. Fix incorrect accessing of pfree'd memory in Memoize

  2. Fix memory leak in Memoize code