From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Andres Freund <andres(at)anarazel(dot)de> |
Cc: | pgsql-committers(at)postgresql(dot)org |
Subject: | Re: pgsql: Remove BufFile's isTemp flag. |
Date: | 2017-11-17 16:23:54 |
Message-ID: | 32216.1510935834@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
I wrote:
> Andres Freund <andres(at)anarazel(dot)de> writes:
>> On 2017-11-16 21:58:14 -0500, Tom Lane wrote:
>>> [ squint... ] That used to have an actual purpose connected to
>>> transaction-abort cleanup, IIRC. It disturbs me that this seems
>>> to have been lost.
>> I've not found any such use, searching through buffile.c's history. I
>> don't quite see how that flag could've been related to abort cleanup
>> stuff? There's been another unused caller of makeBufFile, namely
>> BufFileCreate, that has been #ifdef'ed out for ages (perhaps we
>> should've removed that with this commit or a long time ago). Other than
>> that there seems to not have been any other caller setting that flag
>> differently since you created the file in db3c4c3a2d980dcd.
OK, after looking through the history, the reason for isTemp = false
is indeed to allow BufFileCreate() to maintain its old semantics,
wherein you could attach a BufFile to an already-existing, possibly
non-temp file. There have not been any core callers of BufFileCreate()
in a long time (maybe not since that commit, in fact), but I imagine
I left it alone for fear that extensions might be using it. I see though
that Bruce ifdef'd it out in 20ad43b5, so there aren't any extensions
using it either.
We should flat-out remove the function, since this change makes it
impossible to resurrect with its old semantics. I wonder whether
we should then rename BufFileCreateTemp to just BufFileCreate,
since it's no longer possible to have a BufFile that isn't temp.
I suspect that some attention to the comments might be needed too.
Or maybe we should revert 11e264517. It doesn't seem to be buying
much to make up for the loss of flexibility.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Robert Haas | 2017-11-17 16:53:06 | pgsql: Set proargmodes for satisfies_hash_partition. |
Previous Message | Tom Lane | 2017-11-17 03:17:31 | Re: pgsql: Remove BufFile's isTemp flag. |