make pgxc_ctl connect to 'postgres' database when pinging a node
authorTomas Vondra <tomas@2ndquadrant.com>
Thu, 12 Jan 2017 09:47:38 +0000 (10:47 +0100)
committerPavan Deolasee <pavan.deolasee@gmail.com>
Thu, 12 Jan 2017 12:00:14 +0000 (17:30 +0530)
commit06fc226d666f436d634142f7e591462b48aba939
tree8cb12cd872293f1494b5dfe54fc56caff9ca24fc
parent6015fa2386356c62b23135c4e6e487b04d0d0230
make pgxc_ctl connect to 'postgres' database when pinging a node

pingNode() was not specifying database in the connection string,
so the OS username was used implicitly. When such database did
not exist (e.g. when initializing new nodes, under OS account
different from 'postgres'), this resulted in FATAL failures
in the server log:

    FATAL:  database "user" does not exist

Adding 'database=postgres' to the connection string fixes the
issue. It might be useful to allow using custom database names,
but 'postgres' is pretty much guaranteed to exist.

Bug report by me, patch by Pavan Deolasee.
contrib/pgxc_ctl/utils.c