Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-27 Thread Tom Lane
Andrew Gierth writes: > "Tom" == Tom Lane writes: > Tom> We've discussed doing $SUBJECT off and on for nearly ten years, > So, this is also changing (indirectly) the effect of ReScanExprContext > so that deletes child contexts too. Right, this is actually the main point so far as I'm concerned

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Andrew Gierth
> "Tom" == Tom Lane writes: Tom> We've discussed doing $SUBJECT off and on for nearly ten years, Tom> the oldest thread I could find about it being here: Tom> http://www.postgresql.org/message-id/flat/1186435268.16321.37.ca...@dell.linuxdev.us.dell.com Tom> It's come up again every time

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Andres Freund
On 2015-02-26 18:05:46 -0500, Tom Lane wrote: > Andres Freund writes: > > On 2015-02-26 17:45:26 -0500, Tom Lane wrote: > > If the changes breaks some code it's likely actually a good thing: > > Because, as you say, using MemoryContextReset() will likely be the wrong > > thing, and they'll want to

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
Andres Freund writes: > On 2015-02-26 17:45:26 -0500, Tom Lane wrote: >> With all due respect, that's utterly wrong. I have looked at every single >> MemoryContextReset call in the codebase, and as far as I can see the >> *only* one that is in an error path is elog.c:336, which I'm quite certain

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
Andres Freund writes: > I'd really not even be surprised if a committer backpatches a > MemoryContextReset() addition, not realizing it behaves differently in > the back branches. As far as that goes, the only consequence would be a possible memory leak in the back branches; it would not be a rea

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
Andres Freund writes: > ... Without a compiler erroring out people won't > notice that suddenly MemoryContextReset deletes much more; leading to > possibly hard to find errors. BTW, so far as *data* is concerned, the existing call deletes all data in the child contexts already. The only not-alre

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Andres Freund
On 2015-02-26 17:45:26 -0500, Tom Lane wrote: > Andres Freund writes: > Or are you arguing for an alternative proposal in which we remove > MemoryContextReset (or at least rename it to something new) and thereby > intentionally break all code that uses MemoryContextReset? Yes, that I am. After a

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
Andres Freund writes: > On 2015-02-26 17:01:53 -0500, Tom Lane wrote: >> We've discussed doing $SUBJECT off and on for nearly ten years, >> the oldest thread I could find about it being here: >> http://www.postgresql.org/message-id/flat/1186435268.16321.37.ca...@dell.linuxdev.us.dell.com >> It's c

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Andres Freund
On 2015-02-26 23:31:16 +0100, Andres Freund wrote: > Without a compiler erroring out people won't notice that suddenly > MemoryContextReset deletes much more; leading to possibly hard to find > errors. Context resets frequently are in error paths, and those won't > necessarily be hit when running w

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Andres Freund
Hi, On 2015-02-26 17:01:53 -0500, Tom Lane wrote: > We've discussed doing $SUBJECT off and on for nearly ten years, > the oldest thread I could find about it being here: > http://www.postgresql.org/message-id/flat/1186435268.16321.37.ca...@dell.linuxdev.us.dell.com > It's come up again every time

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
Alvaro Herrera writes: > Tom Lane wrote: >> Thoughts? Any objections to pushing this? > Is there any reason at all to keep > MemoryContextResetButPreserveChildren()? Since your patch doesn't add > any callers, it seems pretty likely that there's none anywhere. The only reason to keep it is to

Re: [HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Alvaro Herrera
Tom Lane wrote: > Thoughts? Any objections to pushing this? Is there any reason at all to keep MemoryContextResetButPreserveChildren()? Since your patch doesn't add any callers, it seems pretty likely that there's none anywhere. -- Álvaro Herrerahttp://www.2ndQuadrant.com/ Pos

[HACKERS] Renaming MemoryContextResetAndDeleteChildren to MemoryContextReset

2015-02-26 Thread Tom Lane
We've discussed doing $SUBJECT off and on for nearly ten years, the oldest thread I could find about it being here: http://www.postgresql.org/message-id/flat/1186435268.16321.37.ca...@dell.linuxdev.us.dell.com It's come up again every time we found another leak of dead child contexts, which happene