Re: Calling PrepareTempTablespaces in BufFileCreateTemp

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Ashwin Agrawal <aagrawal@pivotal.io>, Peter Geoghegan <pg@bowt.ie>, Melanie Plageman <melanieplageman@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2019-04-26T15:05:11Z
Lists: pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> I think that one piece is missing from the patch.  Wouldn't it be
> better to add an assertion at the beginning of OpenTemporaryFile() to
> make sure that PrepareTempTablespaces() has been called when interXact
> is true?  We could just go with that:
> Assert(!interXact || TempTablespacesAreSet());

The version that I posted left it to GetNextTempTableSpace to assert
that.  That seemed cleaner to me than an Assert that has to depend
on interXact.

			regards, tom lane



Commits

  1. Make BufFileCreateTemp() ensure that temp tablespaces are set up.