commit 2072f9d0ac7a1f080eb9a205b59a6896e5b98fdc Author: FURUHASHI Sadayuki Date: Wed Dec 10 16:48:00 2014 -0800 Fix error handling at init_system_db_connection() to not use ereport(ERROR). Because do_child() calls init_system_db_connection() before initializing PG_exception_stack, init_system_db_connection() can't use ereport(ERROR). A workaround this commit adds is calling child_exit(1) as error handling at pool_init_cp() does. diff --git a/src/protocol/child.c b/src/protocol/child.c index 5d609ca..735db7a 100644 --- a/src/protocol/child.c +++ b/src/protocol/child.c @@ -1753,10 +1753,11 @@ static void init_system_db_connection(void) nRet = system_db_connect(); if (nRet || PQstatus(system_db_info->pgconn) != CONNECTION_OK) { - ereport(ERROR, + /* here can't use ereport(ERROR) because PG_exception_stack is not set yet */ + ereport(WARNING, (errmsg("failed to make persistent system db connection"), errdetail("system_db_connect failed"))); - + child_exit(1); } system_db_info->connection = make_persistent_db_connection(pool_config->system_db_hostname,