Re: [patch] [doc] Minor variable related cleanup and rewording of plpgsql docs

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [patch] [doc] Minor variable related cleanup and rewording of plpgsql docs
Date: 2020-11-30 07:51:15
Message-ID: CAFj8pRD4qiwhEGK3qveY_GGbZLw9LXcVeu0zhrhZg_Y9UhxSjg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

po 30. 11. 2020 v 4:24 odesílatel David G. Johnston <
david(dot)g(dot)johnston(at)gmail(dot)com> napsal:

> On Thu, Nov 26, 2020 at 12:49 AM Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
>
>>
>>
>> čt 26. 11. 2020 v 6:41 odesílatel David G. Johnston <
>> david(dot)g(dot)johnston(at)gmail(dot)com> napsal:
>>
>>> Hackers,
>>>
>>> Bug # 16519 [1] is another report of confusion regarding trying to use
>>> parameters in improper locations - specifically the SET ROLE command within
>>> pl/pgsql. I'm re-attaching the doc patch and am adding it to the
>>> commitfest.
>>>
>>
>> I checked this patch, and I think so it is correct - my comments are just
>> about enhancing by some examples
>>
>>>
>>>
> Thank you for the review.
>
> v2 attached.
>
> I added examples in the two places you noted.
>
> Upon re-reading, I decided that opening up the section by including
> everything then fitting in parameters with an exception for utility
> commands (without previously/otherwise identifying them) forced some
> undesirable verbosity. Instead, I opened up with the utility commands as
> the main body of non-result returning commands and then moved onto
> delete/insert/update non-returning cases when the subsequent paragraph
> regarding parameters can then refer to the second class (by way of
> excluding the first class). This seems to flow better, IMO.
>

I have no objections, but maybe these pages are a little bit unclear
generally, because the core of the problem is not described.

Personally I miss a description of the reason why variables cannot be used
- the description "variables cannot be used in statements without result"
is true, but it is not core information.

The important fact is usage of an execution plan or not. The statements
with an execution plan can be parametrized (DML - INSERT, UPDATE, DELETE),
and SELECT. The statements without execution plans should not be
parametrized. The only execution via execution plan executor allows
parametrization. DDL statements are executed via utility execution, and
their parameterization is not supported.

Regards

Pavel

> David J.
>
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2020-11-30 08:21:39 obsolete comment from WITH OIDS days
Previous Message Alexander Korotkov 2020-11-30 07:46:48 Re: Improving spin-lock implementation on ARM.