Skip site navigation (1) Skip section navigation (2)

Re: BUG #3969: pg_ctl cannot detect server startup

From: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: pgsql-bugs(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: BUG #3969: pg_ctl cannot detect server startup
Date: 2008-02-20 03:05:11
Message-ID: 20080220115149.637F.52131E4D@oss.ntt.co.jp (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
"ITAGAKI Takahiro" <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp> wrote:

> Bug reference:      3969
> Description:        pg_ctl cannot detect server startup
> Details: 
> pg_ctl -w -o "-p 5432 -c max_connections=100" start
> waits for server startup forever and timeout,
> but server has successfully started actually.

I found this bug comes from the definition of WHITESPACE
characters in pg_ctl.c. WHITESPACE is defined as folows:
   #define WHITESPACE "\f\n\r\t\v"
In fact, WHITESPACE does not contain whilespace (0x20) :-(
I attach a patch to fix it.

BTW, I also found similar definitions in some places.
(Please grep with "\t\n\r".)
They are a bit different from each other.
For example, whitespaces is defined as " \t\n\r" in tzparser.c.
Is it ok in the inconsistency? Or, should we always use " \f\n\r\t\v" ?


Index: src/bin/pg_ctl/pg_ctl.c
===================================================================
--- src/bin/pg_ctl/pg_ctl.c	(HEAD)
+++ src/bin/pg_ctl/pg_ctl.c	(working copy)
@@ -49,7 +49,7 @@
 typedef long pgpid_t;
 
 
-#define WHITESPACE "\f\n\r\t\v" /* as defined by isspace() */
+#define WHITESPACE " \f\n\r\t\v" /* as defined by isspace() */
 
 /* postgres version ident string */
 #define PM_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n"


Regards,
---
ITAGAKI Takahiro
NTT Open Source Software Center


Attachment: WHITESPACE.patch
Description: application/octet-stream (873 bytes)

In response to

Responses

pgsql-bugs by date

Next:From: Maxime CarbonneauDate: 2008-02-20 05:57:29
Subject: BUG #3972: ERROR: function 59015 returned NULL
Previous:From: Ricardo DavidDate: 2008-02-19 13:10:57
Subject: BUG #3970: ODBC Unknown Sizes Bug?

pgsql-patches by date

Next:From: Heikki LinnakangasDate: 2008-02-20 10:29:26
Subject: Re: tzcode update
Previous:From: Magnus HaganderDate: 2008-02-19 15:53:40
Subject: Re: Proposed patch to change TOAST compression strategy

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group