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

Commitbe3a24d

Browse files
committed
Force the TZ environment variable to be set during initdb. This is to
short-circuit the rather expensive identify_system_timezone() procedure,which we have no real need for during initdb since nothing done here dependson the timezone setting. Since we launch quite a few standalone backendsduring the initdb sequence, this adds up to a significant savings, and seemsworth doing to save developer time even though it will hardly matter to endusers. Per my report today on pgsql-hackers.
1 parentf5fd651 commitbe3a24d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.178 2009/12/11 03:34:56 itagaki Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.179 2009/12/18 18:45:50 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -2712,6 +2712,14 @@ main(int argc, char *argv[])
27122712
sprintf(pgdenv,"PGDATA=%s",pg_data);
27132713
putenv(pgdenv);
27142714

2715+
/*
2716+
* Also ensure that TZ is set, so that we don't waste time identifying the
2717+
* system timezone each of the many times we start a standalone backend.
2718+
* It's okay to use a hard-wired value here because nothing done during
2719+
* initdb cares about the timezone setting.
2720+
*/
2721+
putenv("TZ=GMT");
2722+
27152723
if ((ret=find_other_exec(argv[0],"postgres",PG_BACKEND_VERSIONSTR,
27162724
backend_exec))<0)
27172725
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp