aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/initdb/initdb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 35e39ce4b31..3ed0d95df44 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -1781,6 +1781,13 @@ setup_description(FILE *cmdfd)
" WHERE opdesc NOT LIKE 'deprecated%' AND "
" NOT EXISTS (SELECT 1 FROM pg_description "
" WHERE objoid = p_oid AND classoid = 'pg_proc'::regclass);\n\n");
+
+ /*
+ * Even though the tables are temp, drop them explicitly so they don't get
+ * copied into template0/postgres databases.
+ */
+ PG_CMD_PUTS("DROP TABLE tmp_pg_description;\n\n");
+ PG_CMD_PUTS("DROP TABLE tmp_pg_shdescription;\n\n");
}
#ifdef HAVE_LOCALE_T
@@ -1941,6 +1948,12 @@ setup_collation(FILE *cmdfd)
" WHERE NOT EXISTS (SELECT 1 FROM pg_collation WHERE collname = tmp_pg_collation.collname)"
" ORDER BY collname, encoding, (collname = locale) DESC, locale;\n\n");
+ /*
+ * Even though the table is temp, drop it explicitly so it doesn't get
+ * copied into template0/postgres databases.
+ */
+ PG_CMD_PUTS("DROP TABLE tmp_pg_collation;\n\n");
+
pclose(locale_a_handle);
if (count == 0 && !debug)