pgsql: Add a direct function call mechanism using the caller's context.

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add a direct function call mechanism using the caller's context.
Date: 2017-03-21 13:00:06
Message-ID: E1cqJOQ-0000Jz-V7@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add a direct function call mechanism using the caller's context.

The current DirectFunctionCall functions use NULL as the flinfo in
initializing the FunctionCallInfoData for the call. That means the
called function has no fn_mcxt or fn_extra to work with, and attempting
to do so will result in an access violation. These functions instead use
the provided flinfo, which will usually be the caller's own flinfo. The
caller needs to ensure that it doesn't use the fn_extra in way that is
incompatible with the way the called function will use it. The called
function should not rely on anything else in the provided context, as it
will be relevant to the caller, not the callee.

Original code from Tom Lane.

Discussion: https://postgr.es/m/db2b70a4-78d7-294a-a315-8e7f506c5978@2ndQuadrant.com

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/29bf5016835a2c2c23786f7cda347716c083d95f

Modified Files
--------------
src/backend/utils/fmgr/fmgr.c | 50 +++++++++++++++++++++++++++++++++++++++++++
src/include/fmgr.h | 13 +++++++++++
2 files changed, 63 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Teodor Sigaev 2017-03-21 13:23:37 pgsql: Fix support for some operators (&<, &>, $<|, |&>) in box operato
Previous Message Peter Eisentraut 2017-03-21 12:33:56 pgsql: doc: Improve markup