pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: robert <robert@redcor.ch>
Cc: pgsql-admin@postgresql.org
Subject: Re: pg_restore has problems with restoring sequences.
Date: Sun, 04 Feb 2018 13:16:09 -0500
Message-ID: <18202.1517768169@sss.pgh.pa.us> (raw)
In-Reply-To: <a356f4bf-c2db-3af3-b713-ec3f3e899717@redcor.ch>
References: <129cd073-60bf-96db-e129-24bd9a37319e@redcor.ch>
	<15766.1517758986@sss.pgh.pa.us>
	<a356f4bf-c2db-3af3-b713-ec3f3e899717@redcor.ch>

robert <robert@redcor.ch> writes:
> pg_restore: [archiver (db)] Error while PROCESSING TOC:
> pg_restore: [archiver (db)] Error from TOC entry 1068; 1259 142848 SEQUENCE 
> change_email_domain_id_seq odoo
> pg_restore: [archiver (db)] could not execute query: ERROR:  syntax error at or 
> near "AS"
> LINE 2:     AS integer
>              ^
>      Command was: CREATE SEQUENCE change_email_domain_id_seq
>      AS integer
>      START WITH 1
>      INCREMENT BY 1
>      NO MINVALUE
>      NO MAXVALU...

Hm.  What this suggests is that you're using a pg_dump that is newer than
the server that you're trying to restore to.  The "AS datatype" clause
in CREATE SEQUENCE is new in v10.

The general rule for pg_dump version choice is "use the newest version you
can, but not newer than the server you're going to restore to".  Otherwise
you run into problems like this of the dump containing syntax the target
server doesn't understand.

			regards, tom lane




view thread (7+ messages)  latest in thread

Message-ID: <18202.1517768169@sss.pgh.pa.us>
Permalink:  ../18202.1517768169@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/18202.1517768169@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, robert@redcor.ch
  Subject: Re: pg_restore has problems with restoring sequences.
  In-Reply-To: <18202.1517768169@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox