How to dump a postgres DB into a .sql file
<p>I have a "cinema" DB in postgres and I want to dump all its tables and data in a cinema.sql file.</p>

<p>This file will contain all the sql code for re-creating the schema, tables and filling them with the data.</p>

<p>I already have a bank.sql file (for the "bank" DB) which I can execute via PSQL console in pg Admin III and import using the command</p>

<pre><code>/i *path to my bank.sql file*
</code></pre>

<p>Now, I want to produce a cinema.sql file like bank.sql, but I don't know how to do it.</p>

<p>It's not the backup/restore feature of course, because it produces a .backup file.</p>

<p>I've also tried </p>

<pre><code>pg dump &gt; cinema.dump
</code></pre>

<p>In PSQL console but I can't find a .sql file anywhere, so I don't think it is what I'm looking for either.</p>

<p>Couldn't find anything useful for what I need in Postgres documentation unfortunately so I hope you can help me because I'm just a beginner.</p>

<p>Thanks.</p>