How to fix postgres stuck in recovery mode? I have Jira and Confluence installed in a server. We didn't have any free disk space one day, and these services didn't started correctly, so after deleting some files we now have some free space available. The problem now, is that postgres seems not to start correctly. It's in this recovery mode, but it can't get out of it.

valter@web:~$ ps -ef | grep post
postgres 14580     1  0 Jan03 ?        00:01:16 /usr/lib/postgresql/9.3/bin/postgres -D /var/lib/postgresql/9.3/main -c config_file=/etc/postgresql/9.3/main/postgresql.conf
postgres 14581 14580  0 Jan03 ?        00:00:00 postgres: startup process   recovering 000000010000000A0000000D                                                             


Any idea what is going on here ?

valter@web:~$ sudo ls -ltha /var/lib/postgresql/9.3/main/pg_clog/
total 3,9M

drwx------ 15 postgres postgres 4,0K Jan  3 12:41 ..
drwx------  2 postgres postgres 4,0K Jan  3 12:34 .
-rw-------  1 postgres postgres  48K Jan  3 12:41 000E
-rw-------  1 postgres postgres 256K Jan  3 12:30 000D
-rw-------  1 postgres postgres 256K Nov 15 09:39 000C
-rw-------  1 postgres postgres 256K Okt 13 23:07 000B
-rw-------  1 postgres postgres 256K Sep 11 23:11 000A
-rw-------  1 postgres postgres 256K Aug  8 10:45 0009
-rw-------  1 postgres postgres 256K Jul  3  2015 0008
-rw-------  1 postgres postgres 256K Mai 26  2015 0007
-rw-------  1 postgres postgres 256K Apr 17  2015 0006
-rw-------  1 postgres postgres 256K Mär  9  2015 0005
-rw-------  1 postgres postgres 256K Jan 30  2015 0004
-rw-------  1 postgres postgres 256K Dez 19  2014 0003
-rw-------  1 postgres postgres 256K Nov  9  2014 0002
-rw-------  1 postgres postgres 256K Sep 29  2014 0001
-rw-------  1 postgres postgres 256K Aug 22  2014 0000


EDIT 1:

valter@web:~/9.3/main/pg_xlog$ ls -ltha
total 97M
drwx------ 15 postgres postgres 4.0K Jan  3 12:41 ..
-rw-------  1 postgres postgres  16M Jan  1 12:16 000000010000000A0000000D
-rw-------  1 postgres postgres  16M Dec 23 00:00 000000010000000A0000000C
drwx------  3 postgres postgres 4.0K Dec 21 23:45 .
-rw-------  1 postgres postgres  16M Dec 21 23:36 000000010000000A00000011
-rw-------  1 postgres postgres  16M Dec 21 19:00 000000010000000A00000010
-rw-------  1 postgres postgres  16M Dec 21 14:25 000000010000000A0000000F
-rw-------  1 postgres postgres  16M Dec 21 09:55 000000010000000A0000000E
drwx------  2 postgres postgres 4.0K Jul 10  2014 archive_status


Server log file:

    valter@web:~/9.3/main/pg_xlog$ tail -f /var/log/postgresql/postgresql-9.3-main.log
    ...
    2016-01-05 17:23:08 CET FATAL:  the database system is starting up
    2016-01-05 17:23:09 CET FATAL:  the database system is starting up
    2016-01-05 17:23:10 CET FATAL:  the database system is starting up
    2016-01-05 17:23:11 CET FATAL:  the database system is starting up
    ...
If you can re import your data, you can uninstall postgresql and reinstall it. And then re import your data. I had a similar issue and this worked for me.

for ubuntu : sudo apt-get --purge remove postgresql-YOUR VERSION