pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: robert <robert@redcor.ch>
To: pgsql-admin@lists.postgresql.org
Subject: Re: pg_restore has problems with restoring sequences.
Date: Mon, 5 Feb 2018 08:28:18 +0100
Message-ID: <b05caa3e-cff4-5583-4307-9caee1ef5f54@redcor.ch> (raw)
In-Reply-To: <18202.1517768169@sss.pgh.pa.us>
References: <129cd073-60bf-96db-e129-24bd9a37319e@redcor.ch>
	<15766.1517758986@sss.pgh.pa.us>
	<a356f4bf-c2db-3af3-b713-ec3f3e899717@redcor.ch>
	<18202.1517768169@sss.pgh.pa.us>

thanks,



On 04.02.2018 19:16, Tom Lane wrote:
> 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
>
I am using postgres 10 on the server where I create the dump
and 10.1 where i try to restore.
however,  the box where I try to restore uses
root@lappi:/home/robert/odoo_instances# pg_restore -V
pg_restore (PostgreSQL) 9.5.10

when I check with :
root@lappi:/home/robert/odoo_instances# apt-cache policy postgresql-client
postgresql-client:
   Installed: (none)
   Candidate: 10+189.pgdg17.04+1
   Version table:
      10+189.pgdg17.04+1 500
         500 http://apt.postgresql.org/pub/repos/apt zesty-pgdg/main 
amd64 Packages
         500 http://apt.postgresql.org/pub/repos/apt zesty-pgdg/main 
i386 Packages
      9.6+184ubuntu1.1 500
         500 http://ch.archive.ubuntu.com/ubuntu artful-updates/main 
amd64 Packages
         500 http://ch.archive.ubuntu.com/ubuntu artful-updates/main 
i386 Packages
         500 http://security.ubuntu.com/ubuntu artful-security/main 
amd64 Packages
         500 http://security.ubuntu.com/ubuntu artful-security/main i386 
Packages
      9.6+184ubuntu1 500
         500 http://ch.archive.ubuntu.com/ubuntu artful/main amd64 Packages
         500 http://ch.archive.ubuntu.com/ubuntu artful/main i386 Packages

and when I try to reinstall
apt install postgresql-client-common
i get a message, that it is already the newest version.

ah, now I see something:$which pg_restore points to:
  /usr/bin/pg_restore -> ../share/postgresql-common/pg_wrapper

what is this pg_wrapper??

thanks

view thread (7+ messages)

Message-ID: <b05caa3e-cff4-5583-4307-9caee1ef5f54@redcor.ch>
Permalink:  ../b05caa3e-cff4-5583-4307-9caee1ef5f54@redcor.ch/
Also on:    postgresql.org/message-id/b05caa3e-cff4-5583-4307-9caee1ef5f54@redcor.ch

 · 

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: robert@redcor.ch, pgsql-admin@lists.postgresql.org
  Subject: Re: pg_restore has problems with restoring sequences.
  In-Reply-To: <b05caa3e-cff4-5583-4307-9caee1ef5f54@redcor.ch>

* 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