Copyright of WAVELET.BIZ
When attempting to create a database under "root" or any other user, there was a error with the keywords "could not connect to xxxx". (forgot the exact error message sorry)
The usual normal troubleshoot would be,
1) restart the postgres service, using /etc/init.d/postgres restart
2) create user "root" (or any user) inside the user postgres ( su - postgres) so that "root" has the permission
However, sometimes it might not work.
Possible solutions:
1) Check if the pg_hba file under /var/lib/pgsql/data is corrupted. Recreate the pg_hba file.
From my newer experiences when installing EMP on FC7, I encountered this problem even after I have started the postgres service. When attempting to createuser in the postgres user, the same error message with the keywords "could not connect to ..." will appear. As I observed, if we go to /var/lib/pgsql/data you will see that this folder is empty. A very useful command would be:
initdb --pgdata = /var/lib/pgsql/data
Did not get to observe the log but I believe this command is to configure the postgres service to allow remote access( in other words allow access to other users).
Once the command completes running, the /var/lib/pgsql/data would be populated and as default, the pg_hba file would be at a configuration as such that for a single server with both app and database, there is no further modification needed for EMP to run. Thus, instead of manually configuring the pg_hba file, we might have an alternative which is to remove files inside /var/lib/pgsql/data and just run the command.