You are not logged in.
I installed PostgreSQL using the "Installing PostgreSQL" section from the Arch Wikipage:
PostgreSQL#Installing_PostgreSQL
Everything worked out just fine, as expected.
Next, I logged in as postgres to set up a new PostgreSQL user, called 'openerp':
sudo su - postgres
I began the process of creating 'openerp' with the following command:
createuser openerp -P
I entered a password, re-entered it, and answered the questions n, y, and n. The result? The following error message - see below:
[postgres@pavilion533w ~]$ createuser openerp -P
Enter password for new role:
Enter it again:
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) n
createuser: could not connect to database postgres: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
A quick purview of the postgresql log shows:
cat /var/log/postgresql.log
LOG: could not translate host name "localhost", service "5432" to address: Name or service not known
WARNING: could not create listen socket for "localhost"
FATAL: could not create any TCP/IP sockets
This is what my hosts file looks like:
cat /etc/hosts
#
# /etc/hosts: static lookup table for host names
#
#<ip-address> <hostname.domain.org> <hostname>
127.0.0.1 localhost.localdomain pavilion533w
64.233.169.103 www.google.com g
I assume that I have to modify the /var/lib/postgres/data/postgresql.conf file to accept local connections.
This is the section that seems to need modifying. Any ideas? Or do I need to tweak something else entirely? I tried uncommenting the the 'listen_addresses' and 'port' lines, and restarting postgresql, but I got the same error message.
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
#listen_addresses = 'localhost' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost', '*' = all
# (change requires restart)
#port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
# Note: Increasing max_connections costs ~400 bytes of shared memory per
# connection slot, plus lock space (see max_locks_per_transaction). You might
# also need to raise shared_buffers to support more connections.
#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directory = '' # (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour_name = '' # defaults to the computer name
# (change requires restart)
Last edited by lseubert (2009-07-31 22:08:27)
"To the question whether I am a pessimist or an optimist, I answer that my knowledge is pessimistic, but my willing and hoping are optimistic."
-- Albert Schweitzer
Offline
I continued digging into documentation and fiddling around, and I finally solved the problem.
Everything is now thoroughly documented on the Open ERP Arch Wikipage.
For some reason, other Arch users I contacted did not have this problem connecting to the localhost through port 5432. I might file a bug with the PostgreSQL maintainer, just to see if the postgresql.conf file was recently changed, leading to this altered behavior.
"To the question whether I am a pessimist or an optimist, I answer that my knowledge is pessimistic, but my willing and hoping are optimistic."
-- Albert Schweitzer
Offline