Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID

Поиск
Список
Период
Сортировка
От Julien Rouhaud
Тема Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID
Дата
Msg-id 20230208063316.atjv6uxb7owm77s6@jrouhaud
обсуждение исходный текст
Ответ на possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On Tue, Feb 07, 2023 at 08:48:22PM +0100, Pavel Stehule wrote:
>
> I have a question about the possibility of simply getting the name of the
> currently executed function. The reason for this request is simplification
> of writing debug messages.
>
> GET DIAGNOSTICS _oid = PG_ROUTINE_OID;
> RAISE NOTICE '... % ... %', _oid, _oid::regproc::text;
>
> The advantage of this dynamic access to function name is always valid value
> not sensitive to some renaming or moving between schemas.
>
> I am able to separate a name from context, but it can be harder to write
> this separation really robustly. It can be very easy to enhance the GET
> DIAGNOSTICS statement to return the oid of currently executed function.
>
> Do you think it can be useful feature?

+1, it would have been quite handy in a few of my projects.



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

Предыдущее
От: Richard Guo
Дата:
Сообщение: Re: A bug in make_outerjoininfo
Следующее
От: Andres Freund
Дата:
Сообщение: Re: pg_stat_bgwriter.buffers_backend is pretty meaningless (and more?)