Can't import PostgreSQL10 dump into 9.6 database : <p><strong><em>I need to somehow convert a v10 dump file into one which is 9.6 compatible</em></strong>  </p>

<p>Google's Cloud SQL runs PostgreSQL version 9.6 and my database has been running on version 10 since its creation. </p>

<p><strong>THE ISSUE</strong>: When trying to import the database into Cloud SQL, I get the <code>an unknown error has occurred.</code> message of death.</p>

<p><em>I have already tried commenting out my postgis / other extensions when importing to Cloud SQL but, to no avail.</em></p>

<p>I have tried using using <code>psql my_96_db &lt; my_10.sql</code> and get tons of errors like this:</p>

<pre><code>...
CREATE TABLE
ERROR:  syntax error at or near "AS"
LINE 2:     AS integer
            ^
ERROR:  relation "authentication_phonecontact_id_seq" does not exist
CREATE TABLE
...
</code></pre>

<p>I have tried using postgres 9.6's pg_restore on my v10 <code>pg_dump -Fc</code> command, but it will not successfully import into a 9.6 database. An example of one of the many failures in the output is </p>

<pre><code>pg_restore: [archiver (db)] could not execute query: ERROR:  relation "public.authentication_referral_id_seq" does not exist
LINE 1: SELECT pg_catalog.setval('public.authentication_referral_id_...
                                 ^
    Command was: SELECT pg_catalog.setval('public.authentication_referral_id_seq', 1, false);
</code></pre>
