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

Commit34f34a0

Browse files
committed
Fix pg_ctl -w to properly wait on server startup.
1 parent3bd7263 commit34f34a0

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎src/bin/pg_ctl/pg_ctl.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.24 2004/07/29 16:11:11 momjian Exp $
7+
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.25 2004/08/21 03:12:55 momjian Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -404,12 +404,23 @@ test_postmaster_connection(void)
404404

405405
for (i=0;i<wait_seconds;i++)
406406
{
407-
if ((conn=PQsetdbLogin(NULL,portstr,NULL,NULL,"template1",NULL,NULL))!=NULL)
407+
if ((conn=PQsetdbLogin(NULL,portstr,NULL,NULL,
408+
"template1",NULL,NULL))!=NULL&&
409+
PQstatus(conn)==CONNECTION_OK)
408410
{
409411
PQfinish(conn);
410412
success= true;
411413
break;
412414
}
415+
else
416+
{
417+
if (!silence_echo)
418+
{
419+
printf(".");
420+
fflush(stdout);
421+
}
422+
pg_usleep(1000000);/* 1 sec */
423+
}
413424
}
414425

415426
returnsuccess;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp