title: How to dump postgresql database on ubuntu?
body: <p>Now i try to backup postgresql database by using python.</p>
  <pre><code>import gzip
  from sh import pg_dump
  
  def dump_database():
      with gzip.open('ticketing.sql', 'wb') as f:
          pg_dump('-h', 'localhost', '-U', 'postgres', 'mydatabase', _out=f)
  dump_database()
  
  
  </code></pre>
  <p>which work normally on my macbook but when i try to run this code on ubuntu server, it error like this.</p>
  <pre><code>pg_dump: [archiver (db)] connection to database &quot;mydatabase&quot; failed: fe_sendauth: no password supplied
  </code></pre>
  <p>So why it not working on ubuntu server and how to fix that.</p>
  <p>Assume if my password = <code>password123</code></p>