[PATCH] Document that directly callable functions may use fn_extra

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема [PATCH] Document that directly callable functions may use fn_extra
Дата
Msg-id CAMsr+YGiK5ZukbdB+dLVLzB13y7eZ42iDMYZEmmiT8N5HR-wcQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: [PATCH] Document that directly callable functions may use fn_extra  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Hi all

I was a puzzled by  src/backend/utils/fmgr/README and fmgr.h's descriptions of fcinfo->flinfo->fn_extra (FmgrInfo.fn_extra) as they seem to conflict with actual usage.

The docs suggest that fl_extra is for the use of function call handlers, but in practice it's also used heavily by function implementations as a cache space.

For example, SQL functions use fn_extra in init_sql_fcache, plpgsql uses it in plpgsql_compile, but also most of the array functions use it for a type cache.

I'm inclined to change the docs to say that functions called directly by the fmgr may also use fn_extra (per existing practice). Handlers that wrap functions usually called directly by the fmgr must save and restore fn_extra or leave it untouched.

Trivial patch to do the above attached.

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
Вложения

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: RFC: Remove contrib entirely
Следующее
От: Amit Langote
Дата:
Сообщение: Re: RFC: Remove contrib entirely