Re: Let plan_cache_mode to be a little less strict

From: Sami Imseih <samimseih(at)gmail(dot)com>
To: Andy Fan <zhihuifan1213(at)163(dot)com>
Cc: Andrei Lepikhov <lepihov(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Let plan_cache_mode to be a little less strict
Date: 2025-07-31 16:52:59
Message-ID: CAA5RZ0vvV5AztkC_yAtjsymUWDmCXPSFpHAdb18KxJMU39N8hA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> This means that the configuration parameter (GUC) currently overrides
> any explicit request for a plan type. The documentation does not clearly
> explain the rationale behind this, at least to me.

The documentation [0] mentions " If this default behavior is
unsuitable, you can alter it by
passing the CURSOR_OPT_GENERIC_PLAN or CURSOR_OPT_CUSTOM_PLAN flag to
SPI_prepare_cursor". The default behavior here is plan_cache_mode = AUTO.

But the docs leave out the fact that is plan_cache_mode is not AUTO, that the
GUC settings take precedence over the cursor_options. I agree as well that is
wrong. I also agree with your fix.

[0] https://www.postgresql.org/docs/current/spi-spi-prepare.html

--
Sami

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul A Jungwirth 2025-07-31 16:53:20 Re: Inval reliability, especially for inplace updates
Previous Message Alvaro Herrera 2025-07-31 16:51:41 Re: log_min_messages per backend type