Fix temporary tablespaces for shared filesets

A likely copy/paste error in 98e8b48053 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
This commit is contained in:
Magnus Hagander 2020-07-03 15:09:06 +02:00
parent 8f9b6d4057
commit ecd9e9f0bc
1 changed files with 1 additions and 1 deletions

View File

@ -1386,7 +1386,7 @@ PrepareTempTablespaces(void)
*/
if (curoid == MyDatabaseTableSpace)
{
tblSpcs[numSpcs++] = InvalidOid;
tblSpcs[numSpcs++] = curoid;
continue;
}