aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/tablespace.c
diff options
context:
space:
mode:
authorMagnus Hagander <magnus@hagander.net>2020-07-03 15:09:06 +0200
committerMagnus Hagander <magnus@hagander.net>2020-07-03 15:10:12 +0200
commit1d94c3965450417ebb0e0fd73ea636df823feeed (patch)
tree1705f90bdd5596e24b3fb6ec537a34c575f66621 /src/backend/commands/tablespace.c
parent95a604eaebd145729d9f8c936b37703a212f27fd (diff)
downloadpostgresql-1d94c3965450417ebb0e0fd73ea636df823feeed.tar.gz
postgresql-1d94c3965450417ebb0e0fd73ea636df823feeed.zip
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
Diffstat (limited to 'src/backend/commands/tablespace.c')
-rw-r--r--src/backend/commands/tablespace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index 051478057f6..f887ee98577 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -1386,7 +1386,7 @@ PrepareTempTablespaces(void)
*/
if (curoid == MyDatabaseTableSpace)
{
- tblSpcs[numSpcs++] = InvalidOid;
+ tblSpcs[numSpcs++] = curoid;
continue;
}