Sempre que tento iniciar o Postgres, ocorre um erro. Mesmo se eu remover o diretório do qual ele reclama, ele ainda falhará.
[root@ip-172-31-15-65 init.d]# service postgresql start
/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
[FAILED]
[root@ip-172-31-15-65 init.d]# service postgresql initdb
Initializing database: mkdir: cannot create directory `/var/lib/pgsql/data/pg_log': File exists
[FAILED]
[root@ip-172-31-15-65 init.d]# rmdir /var/lib/pgsql/data/pg_log
[root@ip-172-31-15-65 init.d]# service postgresql start
/var/lib/pgsql/data is missing. Use "service postgresql initdb" to initialize the cluster first.
[FAILED]
[root@ip-172-31-15-65 init.d]# service postgresql initdb
Initializing database: [FAILED]
[root@ip-172-31-15-65 init.d]# service postgresql initdb
Initializing database: mkdir: cannot create directory `/var/lib/pgsql/data/pg_log': File exists
[FAILED]
Versão: postgresql-server-8.4.20-1.el6_5.x86_64
Responder1
Isso funcionou.
rpm -Uvh http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm
yum install postgresql93-server postgresql93-contrib
service postgresql-9.3 initdb
/etc/init.d/postgresql-9.3 start
chkconfig postgresql-9.3 on
Isso também pode funcionar:
yum install pgdg-centos93.noarch # in place of rpm
service postgres-9.3 start # in place of init.d