pg_get_functiondef() does not show LEAKPROOF for leakproof functions

Поиск
Список
Период
Сортировка
От Jeevan Chalke
Тема pg_get_functiondef() does not show LEAKPROOF for leakproof functions
Дата
Msg-id CAM2+6=U5YLZBre3V3WF9FFuL0gxR1egA3MiPh1Gu0JPsEUD7dg@mail.gmail.com
обсуждение исходный текст
Ответы Re: [BUGS] pg_get_functiondef() does not show LEAKPROOF for leakproof functions  (Michael Paquier <michael.paquier@gmail.com>)
Список pgsql-hackers
Hi,

If function is created with the LEAKPROOF option, then pg_get_functiondef() does not show that in the returned definition.
Is it expected OR are we missing that option in pg_get_functiondef().

However only superuser can define a leakproof function.
Was this the reson we are not showing that in pg_get_functiondef() output?

I don't think we should hide this detail.

Here is the sample testcase to reproduce the issue:

postgres=# CREATE OR REPLACE FUNCTION foobar(i integer) RETURNS integer AS $$
BEGIN
  RETURN i + 1;
END;
$$
STRICT
LEAKPROOF
LANGUAGE plpgsql;
CREATE FUNCTION
postgres=# select pg_get_functiondef((select oid from pg_proc where proname = 'foobar'));
                 pg_get_functiondef                 
-----------------------------------------------------
 CREATE OR REPLACE FUNCTION public.foobar(i integer)+
  RETURNS integer                                   +
  LANGUAGE plpgsql                                  +
  STRICT                                            +
 AS $function$                                      +
 BEGIN                                              +
   RETURN i + 1;                                    +
 END;                                               +
 $function$                                         +
 
(1 row)

postgres=# select proname, proleakproof from pg_proc where proname = 'foobar';
 proname | proleakproof
---------+--------------
 foobar  | t
(1 row)


Attached patch which adds that in pg_get_functiondef().

--
Jeevan B Chalke
Principal Software Engineer, Product Development
EnterpriseDB Corporation
The Enterprise PostgreSQL Company

Вложения

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

Предыдущее
От: Etsuro Fujita
Дата:
Сообщение: Re: Re: 9.5 release notes may need ON CONFLICT DO NOTHING compatibility notice for FDW authors
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Add pg_audit, an auditing extension