Re: rw_redis_fdw: SQL Errors when statement is within a function

From: Christoph Moench-Tegeder <cmt(at)burggraben(dot)net>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: rw_redis_fdw: SQL Errors when statement is within a function
Date: 2018-10-27 22:13:22
Message-ID: 20181027221321.zil4ktkmpkxbpmzv@squirrel.exwg.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

## GPT (gptmailinglists(at)gmail(dot)com):

> Why this incident has been observed when the statement is only within
> a function with variable as input parameter and not when they run
> directly with explicitly defined parameter/ In the first case, plan
> remains stable and does not change; but in the second case plan
> changes.

There you have it: that's exactly the plan caching behaviour described
in the link I posted upthread. PL/pgSQL created a prepared statement
on the first execution of a statement/expression inside a function,
and, to quote that documentation:
If the statement has no parameters, or is executed many times, the
SPI manager will consider creating a generic plan that is not dependent
on specific parameter values[...]

> Anyway, this is too technical for me and even if you respond most
> probably I am not gonna get it.

But perhaps the next person researching similar question will profit
from the mailing list archives.

Regards,
Christoph

--
Spare Space.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message joernbs 2018-10-28 09:31:32 Re: Ltree: set of allowed charcters is limited to [A-Za-z0-9_]. Could the dash "-" be included?
Previous Message Christoph Moench-Tegeder 2018-10-27 22:05:50 Re: rw_redis_fdw: SQL Errors when statement is within a function