Re: AllocSetContextCreate changes breake extensions

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, pgsql-hackers(at)postgresql(dot)org, Christoph Berg <cb(at)df7cb(dot)de>
Subject: Re: AllocSetContextCreate changes breake extensions
Date: 2018-12-02 06:08:22
Message-ID: 87r2f04ggf.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> writes:

[snip]

The commit for this said:

With this change, there is no reason for anybody to call
AllocSetContextCreateExtended directly, so in HEAD I renamed it to

except there IS such a reason: if you need (as I do in pl/lua) to wrap
the call in a catch block, inside a function which takes the name and so
on as a parameter, then you have no option but to do so (since using the
macro errors out on the non-const parameter).

Right now I'm stuck with this:

PLLUA_TRY();
{
#if PG_VERSION_NUM >= 120000
mcxt = AllocSetContextCreateInternal(parent, name, minsz, initsz, maxsz);
#elif PG_VERSION_NUM >= 110000
mcxt = AllocSetContextCreateExtended(parent, name, minsz, initsz, maxsz);
#else
mcxt = AllocSetContextCreate(parent, name, minsz, initsz, maxsz);
#endif
*p = mcxt;
}
PLLUA_CATCH_RETHROW();

which kind of sucks. At least let's revert the pointless name change.

--
Andrew (irc:RhodiumToad)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message legrand legrand 2018-12-02 09:22:07 Re: {PROPOSAL] add session information column to pg_stat_statements
Previous Message Pavel Stehule 2018-12-02 04:10:54 Re: Markdown format output for psql, design notes