Re: pgsql: Remove BufFile's isTemp flag.

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Remove BufFile's isTemp flag.
Date: 2017-11-19 21:55:26
Message-ID: CAEepm=38U=A0Ftk3XV=yqHXubiCoG5mr6wxQpgxTnPVo5tJL=A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Sat, Nov 18, 2017 at 6:58 AM, Andres Freund <andres(at)anarazel(dot)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 Content-Type Size
tidy-buffile.patch application/octet-stream 5.2 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-11-19 22:00:36 Re: pgsql: Remove BufFile's isTemp flag.
Previous Message Tom Lane 2017-11-18 21:46:39 pgsql: Fix compiler warning in rangetypes_spgist.c.