[Pgpool-hackers] database doesnot exist error

Tatsuo Ishii ishii at sraoss.co.jp
Wed May 25 00:49:16 UTC 2011


> Le 05/24/2011 04:00 PM, Asif Rehman a écrit :
>> [...]
>> I was setting up pgpool on my system, and I start getting following error in
>> database server log.
>> 2011-04-22 14:32:01 IST FATAL:  database "postgres" does not exist
>> 
> 
> Which PostgreSQL release do you use? or did you drop the postgres database?
> 
>> So I start looking into the pgpool codebase. where I found that there
>> are at-least three functions that are using "postgres" as hardcoded database
>> name
>> 
>> 1- check_postmaster_started
>> 2- health_check
>> 3- make_persistent_db_connection
> 
> You probably mean establish_persistent_connection.
> 
>> In the first two functions, if postgres is not found, "template1" is used,
>>  But for #3 "postgres" is the only option. Do you think there is any harm in
>> using "template1" instead of "postgres"?
> 
> There shouldn't be any harm to do so. Except you won't be able to create
> database with the default template database (template1) while pgpool is
> connected to the template1 database. But it connects to it every
> health_check_period (or every 30 sec if health_check_period<=0).
> 
> Anyway, this is probably something we should fix. You're not required to
> have a postgres database.

Are you sure? Many of PostgreSQL tools require to have postgres
database. For example, createdb and createuser. So I think a
PostgreSQL configuration without postgres database is broken anyway
and I think pgpool-Ii do not need to take care of the case.

BTW for #3, probably you are talking about
establish_persistent_connection(void) rather than
make_persistent_db_connection() takes database parameter, not fixed
usage of postgres database. establish_persistent_connection() is used
for streaming replication lag check, which is only available 9.0 or
later, which definitely has postgres database if you do not broke.
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese: http://www.sraoss.co.jp


More information about the Pgpool-hackers mailing list