possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID
Дата
Msg-id CAFj8pRA4zMd5pY-B89Gm64bDLRt-L+akOd34aD1j4PEstHHSVQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID  (Kirk Wolak <wolakk@gmail.com>)
Re: possible proposal plpgsql GET DIAGNOSTICS oid = PG_ROUTINE_OID  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-hackers
Hi

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?

The implementation should be trivial.

Comments, notes?

Regards

Pavel


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: OpenSSL 3.0.0 vs old branches
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Assertion failure in SnapBuildInitialSnapshot()