Re: MemoryContextCreate change in PG 11 how should contexts be created

2017-12-19 Thread David Steele
On 12/19/17 10:11 AM, Paul Ramsey wrote: > On Tue, Dec 19, 2017 at 7:00 AM, Tom Lane wrote: >> Paul Ramsey writes: > > If I'm reading right, using MemoryContextRegisterResetCallback on a > AllocSetContext created under our PortalContext should do the trick, > with less direct mucking about into

Re: MemoryContextCreate change in PG 11 how should contexts be created

2017-12-19 Thread Paul Ramsey
On Tue, Dec 19, 2017 at 7:00 AM, Tom Lane wrote: > Paul Ramsey writes: >> Our use of MemoryContextCreate is solely in order to get use >> MemoryContextDelete as a callback so that, at the end of a statement, >> we can clean up externally allocated memory that we're holding in a >> cache. If we ha

Re: MemoryContextCreate change in PG 11 how should contexts be created

2017-12-19 Thread Paul Ramsey
On Tue, Dec 19, 2017 at 6:54 AM, Alvaro Herrera wrote: > Paul Ramsey wrote: > >> Our use of MemoryContextCreate is solely in order to get use >> MemoryContextDelete as a callback so that, at the end of a statement, >> we can clean up externally allocated memory that we're holding in a >> cache. >

Re: MemoryContextCreate change in PG 11 how should contexts be created

2017-12-19 Thread Tom Lane
Paul Ramsey writes: > Our use of MemoryContextCreate is solely in order to get use > MemoryContextDelete as a callback so that, at the end of a statement, > we can clean up externally allocated memory that we're holding in a > cache. If we had some other callback to use for "the statement is > com

Re: MemoryContextCreate change in PG 11 how should contexts be created

2017-12-19 Thread Alvaro Herrera
Paul Ramsey wrote: > Our use of MemoryContextCreate is solely in order to get use > MemoryContextDelete as a callback so that, at the end of a statement, > we can clean up externally allocated memory that we're holding in a > cache. You should not use MemoryContextCreate at all -- it's somewhat o

Re: MemoryContextCreate change in PG 11 how should contexts be created

2017-12-19 Thread Paul Ramsey
On Tue, Dec 19, 2017 at 12:24 AM, Regina Obe wrote: > On December 13th this change to context creation was committed, which broke > PostGIS trunk compile against PostgreSQL 11 head. > https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=9fa6f00b1308d > d10da4eca2f31ccbfc7b35bb461 > > Tic