PostgreSql 9.3 Server doesn't listen after cluster recreate
<p>My postgres server has refused connection before  but I have fixed it using <a href="https://askubuntu.com/questions/50621/cannot-connect-to-postgresql-on-port-5432">this</a> solution.</p>

<blockquote>
  <p>This issue comes from installing the postgres package with out a version number. Although postgres will be installed and it will be the correct version, the script to setup the cluster will not run correctly; it's a packaging issue...</p>
</blockquote>

<p>It suggest to purge and reinstall postgres and it will be fixed. It helped me last time.</p>

<p>Currently my problem is related to PostgreSql UTF-8 issues and so I have to do the following to my working postgres and I cannot just purge and reinstall.</p>

<p>So here is what I did before I lost the connection:</p>

<ul>
<li><code>sudo pg_ctlcluster 9.3 main stop --force</code></li>
<li><code>sudo pg_dropcluster –stop 9.3 main</code></li>
<li><code>LC_ALL="en_US.UTF-8" sudo pg_createcluster --start 9.3 main</code></li>
</ul>

<p>Now the cluster was recreated and the UTF-8 problem was supposedly fixed.</p>

<p>But now I cannot connect to the server.</p>

<p>Here is what I did to try to fix it:</p>

<ul>
<li><code>sudo pg_ctlcluster 9.3 main start</code> 
which told me</li>
<li>Cluster is already running</li>
<li>So I listened to the port with <code>netstat -nlp | grep 5432</code> and it told me that <code>680/postgres</code> is running on the port</li>
<li>After this I tried to restart postgres by doing</li>
<li><code>/etc/init.d/postgresql stop/start</code></li>
<li>All successful but still not connecting to database through pgAdmin III on a remote desktop.</li>
</ul>

<p>Does anyone have a clue what is the root cause here and why am i getting rejected from the connection?</p>

<p>Many thanks!</p>