0

I am using postgres-xl in ubuntu 12.04.

when i try to use createuser temp, psql postgres, createdb newdb error is

createdb: could not connect to database template1: 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"?

my setting is

  listen_addresses = 'localhost'
    port = 9999             
    max_connections = 100   
    unix_socket_directory = '/usr/local/pgsql'


# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:         127.0.0.1/32  
host    all             all             0.0.0.0/0            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     apple                                trust
#host    replication     apple        127.0.0.1/32            trust
#host    replication     apple        ::1/128                 trust
Muhammad Raza
  • 847
  • 1
  • 8
  • 22

2 Answers2

0

I suppose you're trying to connect to coordinator running on port 5432:

connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

But your in your config file port is 9999

listen_addresses = 'localhost'
port = 9999
max_connections = 100

You should run createdb command like this. Database user must have rights to create db.

./createdb --port=9999 --host=localhost --username=<USERNAME>
Igor
  • 41
  • 2
  • 4
0

Well there can be many possible reasons for the error message you received. As suggested by Igor check the configuration file.

Else, I suggest you to use pgxc_ctl command line tool to automatically generate the basic configuration file which you can later change/modify.

Pragun
  • 1,123
  • 8
  • 20