Re: AllocSetContextCreate changes breake extensions - Mailing list pgsql-hackers

From Andrew Gierth
Subject Re: AllocSetContextCreate changes breake extensions
Date
Msg-id 87r2f04ggf.fsf@news-spur.riddles.org.uk
Whole thread Raw
In response to Re: AllocSetContextCreate changes breake extensions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: AllocSetContextCreate changes breake extensions  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.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)


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Markdown format output for psql, design notes
Next
From: legrand legrand
Date:
Subject: Re: {PROPOSAL] add session information column to pg_stat_statements