From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@postgresql.org
Subject: pgsql: Add a direct function call mechanism using the caller's context.
Date: Tue, 21 Mar 2017 13:00:06 +0000
Message-ID: <E1cqJOQ-0000Jz-V7@gemulon.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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(+)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: andrew@dunslane.net
Subject: Re: pgsql: Add a direct function call mechanism using the caller's context.
In-Reply-To: <E1cqJOQ-0000Jz-V7@gemulon.postgresql.org>
References: <E1cqJOQ-0000Jz-V7@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox