title: Does pg_dump need -C parameter for restoring a database?
body: <p>My intention is to dump a database using:</p>
  
  <pre><code>pg_dump -U postgres -h localhost -p 5432 MYDB | gzip &gt; database_dump.gz
  </code></pre>
  
  <p>And to restore it onto another environment with:</p>
  
  <pre><code>gunzip -c database_dump.gz | ssh 10.10.10.10 \
    psql -1 -U postgres -h localhost -p 5432 MYDB
  </code></pre>
  
  <p>Before I restore the database on the second environment, I'm going to drop the existing database to make way for the new dump (containing newer data).</p>
  
  <p>Here's my question: Do I need to specify the <code>-C</code> parameter in my pg_dump statement so that the outputted dump file contains a <code>CREATE DATABASE</code> statement? I noticed that without the parameter, the dump file does not contain the <code>CREATE DATABASE</code> statement.</p>
  
  <p>According to the 9.1 docs for the <code>-C</code> parameter, "This option is only meaningful for the plain-text format. For the archive formats, you can specify the option when you call pg_restore."  I'm not positive what that means.  As you can see above, I'm restoring using psql and not pg_restore.</p>