Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdad0899

Browse files
committed
In initdb's post-bootstrap phase, drop temp tables explicitly.
Although these temp tables will get removed from template1 at the end ofthe standalone-backend run, that's too late to keep them from gettingcopied into the template0 and postgres databases, now that we use only asingle backend run for the whole sequence. While no real harm is doneby the extra copies (since they'd be deleted on first use of the tempschema), it's still unsightly, and it would mean some wasted cycles forevery database creation for the life of the installation.Oversight in commitc4a8812. Noticed by Amit Langote.
1 parent4bf8716 commitdad0899

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,6 +1781,13 @@ setup_description(FILE *cmdfd)
17811781
" WHERE opdesc NOT LIKE 'deprecated%' AND "
17821782
" NOT EXISTS (SELECT 1 FROM pg_description "
17831783
" WHERE objoid = p_oid AND classoid = 'pg_proc'::regclass);\n\n");
1784+
1785+
/*
1786+
* Even though the tables are temp, drop them explicitly so they don't get
1787+
* copied into template0/postgres databases.
1788+
*/
1789+
PG_CMD_PUTS("DROP TABLE tmp_pg_description;\n\n");
1790+
PG_CMD_PUTS("DROP TABLE tmp_pg_shdescription;\n\n");
17841791
}
17851792

17861793
#ifdefHAVE_LOCALE_T
@@ -1941,6 +1948,12 @@ setup_collation(FILE *cmdfd)
19411948
" WHERE NOT EXISTS (SELECT 1 FROM pg_collation WHERE collname = tmp_pg_collation.collname)"
19421949
" ORDER BY collname, encoding, (collname = locale) DESC, locale;\n\n");
19431950

1951+
/*
1952+
* Even though the table is temp, drop it explicitly so it doesn't get
1953+
* copied into template0/postgres databases.
1954+
*/
1955+
PG_CMD_PUTS("DROP TABLE tmp_pg_collation;\n\n");
1956+
19441957
pclose(locale_a_handle);
19451958

19461959
if (count==0&& !debug)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp