Removing WITH clause support in CREATE FUNCTION, for isCachable andisStrict

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Removing WITH clause support in CREATE FUNCTION, for isCachable andisStrict
Дата
Msg-id 20180115022748.GB1724@paquier.xyz
обсуждение исходный текст
Ответы Re: Removing WITH clause support in CREATE FUNCTION, for isCachable and isStrict
Список pgsql-hackers
Hi all,

As noticed by Daniel here:
https://www.postgresql.org/message-id/D5F34C9D-3AB7-4419-AF2E-12F67581D71D@yesql.se

Using a WITH clause takes precendence over what is defined in the main
function definition when using isStrict and isCachable. For example,
when using VOLATILE and IMMUTABLE, an error is raised:
=# create function int42(cstring) returns int42 AS 'int4in'
   language internal strict immutable volatile;
ERROR:  42601: conflicting or redundant options
LINE 2:     language internal strict immutable volatile;

However when using for example STABLE/VOLATILE in combination with a
WITH clause, then things get prioritized, and in this case the WITH
clause values are taken into account:
=# create function int42(cstring) returns int42 AS 'int4in'
   language internal strict volatile with (isstrict, iscachable);
CREATE FUNCTION
=# select provolatile from pg_proc where proname = 'int42';
 provolatile
-------------
 i
(1 row)

This clause is marked as deprecated since 7.3, so perhaps it would be
time to remove completely its support? It seems to me that this leads to
more confusion than being helpful. And I have not found a trace of code
using those flags on github or such.

Thanks,
--
Michael

Вложения

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

Предыдущее
От: Edmund Horner
Дата:
Сообщение: Re: PATCH: psql tab completion for SELECT
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: [HACKERS] Useless code in ExecInitModifyTable