Re: Error-safe user functions
От | David G. Johnston |
---|---|
Тема | Re: Error-safe user functions |
Дата | |
Msg-id | CAKFQuwYEBZw5UrPSa6U5=A+a82dagAYBfoZLYb4CuBxbE1vTmA@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Error-safe user functions (Andres Freund <andres@anarazel.de>) |
Список | pgsql-hackers |
On Wed, Dec 7, 2022 at 10:34 AM Andres Freund <andres@anarazel.de> wrote:
> +{ oid => '8053',
> + descr => 'get error message if string is not valid input for data type',
> + proname => 'pg_input_invalid_message', provolatile => 's',
> + prorettype => 'text', proargtypes => 'text regtype int4',
> + prosrc => 'pg_input_invalid_message_mod' },
> +
Is there a guarantee that input functions are stable or immutable? We don't
have any volatile input functions in core PG:
SELECT provolatile, count(*) FROM pg_proc WHERE oid IN (SELECT typinput FROM pg_type) GROUP BY provolatile;
Effectively yes, though I'm not sure if it is formally documented or otherwise enforced by the system.
The fact we allow stable is a bit of a sore spot, volatile would be a terrible property for an I/O function.
David J.
В списке pgsql-hackers по дате отправления: