Re: AllocSetContextCreate changes breake extensions

2018-12-02 Thread Andrew Gierth
> "Tom" == Tom Lane writes: >> 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-cons

Re: AllocSetContextCreate changes breake extensions

2018-12-02 Thread Tom Lane
Andrew Gierth writes: > "Tom" == Tom Lane writes: > 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

Re: AllocSetContextCreate changes breake extensions

2018-12-01 Thread Andrew Gierth
> "Tom" == Tom Lane 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

Re: AllocSetContextCreate changes breake extensions

2018-10-12 Thread Tom Lane
Andres Freund writes: > On 2018-10-12 13:51:53 -0400, Tom Lane wrote: >> Shall we also backpatch the ALLOCSET_*_SIZES macros as Christoph >> suggested? I'm not convinced of the usefulness of that, since >> extensions would still have to cope with them not being present >> when building against ex

Re: AllocSetContextCreate changes breake extensions

2018-10-12 Thread Andres Freund
On 2018-10-12 13:51:53 -0400, Tom Lane wrote: > Andres Freund writes: > > But can't we just do something like: > > > #if defined(HAVE__BUILTIN_CONSTANT_P) && defined(HAVE__VA_ARGS) > > #define AllocSetContextCreate(parent, name, ...) \ > > (StaticAssertExpr(__builtin_constant_p(name), \ > >

Re: AllocSetContextCreate changes breake extensions

2018-10-12 Thread Tom Lane
Andres Freund writes: > But can't we just do something like: > #if defined(HAVE__BUILTIN_CONSTANT_P) && defined(HAVE__VA_ARGS) > #define AllocSetContextCreate(parent, name, ...) \ > (StaticAssertExpr(__builtin_constant_p(name), \ > "memory context nam

Re: AllocSetContextCreate changes breake extensions

2018-10-12 Thread Andres Freund
On 2018-10-12 13:20:16 -0400, Tom Lane wrote: > Andres Freund writes: > > Christoph Berg, on IRC, raised the issue that at least one extension > > failed compiling in v11. The extension currently does: > > https://github.com/pgq/pgq/blob/master/triggers/common.c#L225 > > tbl_cache_ctx = AllocS

Re: AllocSetContextCreate changes breake extensions

2018-10-12 Thread Chapman Flack
On 10/12/2018 01:10 PM, Christoph Berg wrote: > Re: Andres Freund 2018-10-12 > Andres' idea would enable the old code to continue to work, but > couldn't we additionally to backpatch the ALLOCSET_*_SIZES macros, so > the new code works also on old versions that didn't get the new > AllocSetContext

Re: AllocSetContextCreate changes breake extensions

2018-10-12 Thread Tom Lane
Andres Freund writes: > Christoph Berg, on IRC, raised the issue that at least one extension > failed compiling in v11. The extension currently does: > https://github.com/pgq/pgq/blob/master/triggers/common.c#L225 > tbl_cache_ctx = AllocSetContextCreate(TopMemoryContext, >

Re: AllocSetContextCreate changes breake extensions

2018-10-12 Thread Christoph Berg
Re: Andres Freund 2018-10-12 <20181012170355.bhxi273skjt6s...@alap3.anarazel.de> > Hi, > > Christoph Berg, on IRC, raised the issue that at least one extension > failed compiling in v11. The extension currently does: > https://github.com/pgq/pgq/blob/master/triggers/common.c#L225 Others have alre

AllocSetContextCreate changes breake extensions

2018-10-12 Thread Andres Freund
Hi, Christoph Berg, on IRC, raised the issue that at least one extension failed compiling in v11. The extension currently does: https://github.com/pgq/pgq/blob/master/triggers/common.c#L225 tbl_cache_ctx = AllocSetContextCreate(TopMemoryContext,