Re: Calling PrepareTempTablespaces in BufFileCreateTemp
Ashwin Agrawal <aagrawal@pivotal.io>
From: Ashwin Agrawal <aagrawal@pivotal.io>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Geoghegan <pg@bowt.ie>,
Melanie Plageman <melanieplageman@gmail.com>,
Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2019-04-25T17:40:01Z
Lists: pgsql-hackers
On Thu, Apr 25, 2019 at 9:45 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > However, by that argument we should change all 3 of these functions to > set up the data. If we're eating the layering violation to the extent > of letting OpenTemporaryFile call into commands/tablespace, then there's > little reason for the other 2 not to do likewise. > I agree to that point, same logic should be used for all three calls irrespective of the approach we pick. I still remain concerned that invoking catalog lookups from fd.c is a darn > bad idea, even if we have a fallback for it to work (for some value of > "work") in non-transactional states. It's not really hard to envision > that kind of thing leading to infinite recursion. I think it's safe > right now, because catalog fetches shouldn't lead to any temp-file > access, but that's sort of a rickety assumption isn't it? > Is there (easy) way to assert for that assumption? If yes, then can add the same and make it not rickety. Though I agree any exceptions/violations coded generally bites in long run somewhere later.
Commits
-
Make BufFileCreateTemp() ensure that temp tablespaces are set up.
- 93f03dad824f 12.0 landed