Re: Calling PrepareTempTablespaces in BufFileCreateTemp - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Calling PrepareTempTablespaces in BufFileCreateTemp
Date
Msg-id CAAKRu_YxHYQzWx5OZc=MZ_3-twah8NuKoV5USGeaGZ8-amnCxA@mail.gmail.com
Whole thread Raw
In response to Re: Calling PrepareTempTablespaces in BufFileCreateTemp  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

On Tue, Apr 23, 2019 at 1:06 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
There are three functions in fd.c that have a dependency on the
temp tablespace info having been set up:
        OpenTemporaryFile
        GetTempTablespaces
        GetNextTempTableSpace
This patch makes the first of those automatically set up the info
if it's not done yet.  The second one has always had an assertion
that the caller did it already, and now the third one does too.
An about equally plausible change would be to make all three
call PrepareTempTablespaces, but there are so few callers of the
second and third that I'm not sure that'd be better.  Thoughts?


I think an assertion is sufficiently clear for GetNextTempTableSpace based on
what it does and its current callers. The same is probably true for
GetTempTableSpaces.

--
Melanie Plageman

pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: pg_dump partitions can lead to inconsistent state after restore
Next
From: Tom Lane
Date:
Subject: Re: Calling PrepareTempTablespaces in BufFileCreateTemp