title: How to get the PostgreSQL db backup from slave if master down
body: <p>I have setup <strong>PostgreSQL</strong> hot stand by replication on Ubuntu. I need to know if master DB server is down, then how to get the backup from the slave.</p>
  
  <p>I have tried this command</p>
  
  <pre><code>pg_dump testdb &gt; /var/lib/postgresql/20190306.bak -p 5433
  </code></pre>
  
  <p>I got this error:</p>
  
  <pre><code>pg_dump: [archiver (db)] connection to database "channeldb" failed:
  FATAL:  role "root" does not exist
  </code></pre>