1
votes

I was connected with remote postgres-9.3 by pgAdmin III. After close pgAdmin i try to connect on another day with the same db.

 /etc/init.d/postgresql-9.3 status
 dead but pid file exists
service postgresql-9.3 start     FAIL

In pgstartup.log file i have:

This account is currently not available

pg_hba.conf:

# "local" is for Unix domain socket connections only
local   all             all                                     peer
host    all             all             127.0.0.1/32            trust
host    all             all             89.70.224.82/32         md5

Operating system on server is CentOS. I don't know unfortunately how postgres was installed on the server because someone else done that. What i can do with this?

2
A hint - the contents of pg_hba.conf is irrelevant. - Milen A. Radev
The error message suggests that the postgres user doesn't have a valid shell. Which leads to the question of what is the operating system and how you installed postgres on it. - Daniel Vérité
I have edited post by add information about Operating system - Michal M.
See the contents of /etc/init.d/postgresql-9.3. Find out as which user postgresql is being started (probably postgres). Check if that user exists in /etc/passwd. - Jayadevan
I have found this line in /etc/passwd: postgres:x:26:26:PostgreSQL Server:/var/lib/pgsql:/sbin/nologin - Michal M.

2 Answers

3
votes

The solution is reset your PostgreSQL logs

[root@user /]#/usr/pgsql-9.3/bin/pg_resetxlog -f /usr/pgsql-9.3/data/

after executing above command display "Transaction log reset"

and then restart PostgreSQL server

[root@user /]# /etc/init.d/postgresql-9.3 restart

Stopping postgresql-9.3 service:                           [FAILED]

Starting postgresql-9.3 service:                           [  OK  ]

[root@qa /]# /etc/init.d/postgresql-9.3 status
 (pid  3003) is running...

after checking your pgadmin

0
votes

Try to start cluster using native postgres utility. Assuming you have CentOS 6.6 and postgresql 9.4

sudo -u postgres /usr/pgsql-9.4/bin/pg_ctl -D <YOUR_DATA_DIR> start

You will get some reasonable output. Then try to start postgres in single user mode

sudo -u postgres /usr/pgsql-9.4/bin/postgres --single -D <YOUR_DATA_DIR> -P -d 1

Beware that resetting xlogs will cause some data lost. I also recommend to read this article http://blog.endpoint.com/2014/11/when-postgres-will-not-start.html