Re: Querying one partition in a function takes locks on all partitions

Laurenz Albe <laurenz.albe@cybertec.at>

From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Renan Alves Fonseca <renanfonseca@gmail.com>, David Rowley <dgrowleyml@gmail.com>
Cc: Evgeny Morozov <postgresql4@realityexists.net>, pgsql-general <pgsql-general@postgresql.org>
Date: 2025-03-31T17:08:02Z
Lists: pgsql-general
On Mon, 2025-03-31 at 18:41 +0200, Renan Alves Fonseca wrote:
> I would add another Note below like:
> "Except when inlined, an SQL function is always executed with a
> generic plan. This behavior may not be desired in some situations, and
> it will be fixed in future versions."

But that is not true, as far as I can tell: just like any other prepared
statement, it may keep using custom plans.

Yours,
Laurenz Albe