Re: When deleting the plpgsql function, release the CachedPlan of the function

From: Vladlen Popolitov <v(dot)popolitov(at)postgrespro(dot)ru>
To: 章晨曦 <zhangchenxi(at)halodbtech(dot)com>
Cc: 曾满 <zengman(at)halodbtech(dot)com>, 陈天 <chentian(at)halodbtech(dot)com>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: When deleting the plpgsql function, release the CachedPlan of the function
Date: 2025-08-20 12:04:44
Message-ID: b2b1dc06d0f9bd9d178b3190ce51fcd5@postgrespro.ru
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

章晨曦 писал(а) 2025-08-19 12:31:

>
> I think you misunderstand Man's meaning. In Man's example, the func
> cache
> neither dropped (will cause memory leak) nor reused. So the question
> here:
>
> 1. Drop the cache when func dropped
> 2. Keep the cache and reused when func recreate
> I prefer the 2ed solution.
>
> Regards,
>
> Jet C.X. ZHANG
Hi

It is why I am asking - the patch does not have a detail
description in text, it is not clear what and why is changed.

What do you mean, when speak about function cache?
What object or function allocate it? I wrote
in my previous email, that function does not have any
cache, it deallocates after the execution everything allocated
and does not have cache. Cached plans are not function cache,
it is the cache of plans for future use by any other functions
or simple query with the same generic or custom plan. They all
are deallocated at least when user decides to close the connection.

Could you clarify, what function cache do you mean?

--
Best regards,

Vladlen Popolitov.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2025-08-20 12:07:37 Re: Adding REPACK [concurrently]
Previous Message Amit Kapila 2025-08-20 11:57:18 Re: Logical Replication of sequences