Re: pgsql: Remove BufFile's isTemp flag. - Mailing list pgsql-committers

From Thomas Munro
Subject Re: pgsql: Remove BufFile's isTemp flag.
Date
Msg-id CAEepm=38U=A0Ftk3XV=yqHXubiCoG5mr6wxQpgxTnPVo5tJL=A@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Remove BufFile's isTemp flag.  (Andres Freund <andres@anarazel.de>)
Responses Re: pgsql: Remove BufFile's isTemp flag.
List pgsql-committers
On Sat, Nov 18, 2017 at 6:58 AM, Andres Freund <andres@anarazel.de> wrote:
> On 2017-11-17 11:23:54 -0500, Tom Lane wrote:
>> 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.
>
> That sounds reasonable.
>
>
>> 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.
>
> Thomas?

Here's a patch that does those things.  I'm slightly surprised by the
renaming suggestion though, because it means that an extension that
uses BufFile will need to know how to select the v10 and v11 function
name as appropriate.  Would you backpatch redirect support for the new
name to older versions?

-- 
Thomas Munro
http://www.enterprisedb.com

Attachment

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Fix compiler warning in rangetypes_spgist.c.
Next
From: Tom Lane
Date:
Subject: Re: pgsql: Remove BufFile's isTemp flag.