Re: Unexpected result from ALTER FUNCTION— looks like a bug

Поиск
Список
Период
Сортировка
От David G. Johnston
Тема Re: Unexpected result from ALTER FUNCTION— looks like a bug
Дата
Msg-id CAKFQuwa6WXVmjJRuDvN=B0Qv1BoLEKPiimXQ3HBJbRMwjS0g+Q@mail.gmail.com
обсуждение исходный текст
Ответ на Unexpected result from ALTER FUNCTION— looks like a bug  (Bryn Llewellyn <bryn@yugabyte.com>)
Ответы Re: Re: Unexpected result from ALTER FUNCTION— looks like a bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Unexpected result from ALTER FUNCTION— looks like a bug  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-general
On Tue, Apr 19, 2022 at 7:07 PM Bryn Llewellyn <bryn@yugabyte.com> wrote:
SUMMARY

This part of the syntax diagram for "alter function":

ALTER FUNCTION name [ ( [ [ argmode ] [ argname ] argtype [, ...] ] ) ] action [ … ]

says that the first "action" can be followed (without punctuation) by zero, one, or many other actions. A semantic rule says that no particular action can be specified more than once. My tests used these possible actions:

 
alter function s1.f()
security invoker
set timezone = 'UTC'
stable
parallel safe;

It brings this new status:

 name | type | security |                        proconfig                        | volatility |  parallel  
------+------+----------+---------------------------------------------------------+------------+------------
 f    | func | invoker  | {TimeZone=UTC}                                          | stable     | restricted

This is the bug.

It has room for improvement from a user experience perspective.

While I haven't experimented with this for confirmation, what you are proposing here (set + parallel safe) is an impossible runtime combination (semantic rule) but perfectly valid to write syntactically.  Your function must either be restricted or unsafe per the rules for specifying parallel mode.

If this is indeed what is happening then the documentation should make note of it.  Whether the server should emit a notice or warning in this situation is less clear.  I'm doubting we would introduce an error at this point but probably should have when parallelism was first added to the system.

David J.

В списке pgsql-general по дате отправления:

Предыдущее
От: Bryn Llewellyn
Дата:
Сообщение: Unexpected result from ALTER FUNCTION— looks like a bug
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: Unexpected result from ALTER FUNCTION— looks like a bug