Fix temporary tablespaces for shared filesets
authorMagnus Hagander <[email protected]>
Fri, 3 Jul 2020 13:09:06 +0000 (15:09 +0200)
committerMagnus Hagander <[email protected]>
Fri, 3 Jul 2020 13:11:17 +0000 (15:11 +0200)
commit8ac0eb51f7bfc5f7c95f2cc2918b623e85899616
treeca33974e95eb327c51f80b26791d3b60d3c8b5f2
parentd353a7633943e954537e5454a757d5c7901afd95
Fix temporary tablespaces for shared filesets

A likely copy/paste error in 98e8b480532 from  back in 2004 would
cause temp tablespace to be reset to InvalidOid if temp_tablespaces
was set to the same value as the primary tablespace in the database.
This would cause shared filesets (such as for parallel hash joins)
to ignore them, putting the temporary files in the default tablespace
instead of the configured one. The bug is in the old code, but it
appears to have been exposed only once we had shared filesets.

Reviewed-By: Daniel Gustafsson
Discussion: https://postgr.es/m/CABUevExg5YEsOvqMxrjoNvb3ApVyH+9jggWGKwTDFyFCVWczGQ@mail.gmail.com
Backpatch-through: 9.5
src/backend/commands/tablespace.c