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

Thanks Tom
On 04.02.2018 16:43, Tom Lane wrote:
> robert <robert@redcor.ch> writes:
>> I use
>>       pg_dump -h localhost  -U USER -Fc DATABASE > dumpfile
> OK ...
>
>> then I restore it with:
>>       dropdb DATABASE
>>       pg_restore -O  -U user  -d DATABASE  dumpfile
> That sequence is missing a createdb step (or else -C in the restore
> switches).
yes, I am using also the -C switch
sorry
>
>> doing this then I get these warnings, and many (not all) sequences are not created.
> Usually the thing to do is look at the very first error; everything after
> that may just be cascading damage.  I kinda doubt what you showed us
> here is the first error.
no its not, but they are all similar, I assumed (maybe wrongly) that it makes no 
difference ..
Here are the first couple:

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...
pg_restore: [archiver (db)] Error from TOC entry 11717; 0 0 SEQUENCE OWNED BY 
change_email_domain_id_seq odoo
pg_restore: [archiver (db)] could not execute query: ERROR: relation 
"change_email_domain_id_seq" does not exist
     Command was: ALTER SEQUENCE change_email_domain_id_seq OWNED BY 
change_email_domain.id;



pg_restore: [archiver (db)] Error from TOC entry 1062; 1259 134467 SEQUENCE 
change_email_wizard_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_wizard_id_seq
     AS integer
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
     NO MAXVALU...
pg_restore: [archiver (db)] Error from TOC entry 11724; 0 0 SEQUENCE OWNED BY 
change_email_wizard_id_seq odoo
pg_restore: [archiver (db)] could not execute query: ERROR: relation 
"change_email_wizard_id_seq" does not exist
     Command was: ALTER SEQUENCE change_email_wizard_id_seq OWNED BY 
change_email_wizard.id;



pg_restore: [archiver (db)] Error from TOC entry 1070; 1259 142859 SEQUENCE 
delete_user_confirm_wizard_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 delete_user_confirm_wizard_id_seq
     AS integer
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
     NO ...
pg_restore: [archiver (db)] Error from TOC entry 12169; 0 0 SEQUENCE OWNED BY 
delete_user_confirm_wizard_id_seq odoo
pg_restore: [archiver (db)] could not execute query: ERROR: relation 
"delete_user_confirm_wizard_id_seq" does not exist
     Command was: ALTER SEQUENCE delete_user_confirm_wizard_id_seq OWNED BY 
delete_user_confirm_wizard.id;



pg_restore: [archiver (db)] Error from TOC entry 1066; 1259 140393 SEQUENCE 
news_publish_queue_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 news_publish_queue_id_seq
     AS integer
     START WITH 1
     INCREMENT BY 1
     NO MINVALUE
     NO MAXVALUE...
pg_restore: [archiver (db)] Error from TOC entry 13336; 0 0 SEQUENCE OWNED BY 
news_publish_queue_id_seq odoo
pg_restore: [archiver (db)] could not execute query: ERROR: relation 
"news_publish_queue_id_seq" does not exist
     Command was: ALTER SEQUENCE news_publish_queue_id_seq OWNED BY 
news_publish_queue.id;


thanks again
robert




view thread (7+ messages)  latest in thread

Message-ID: <a356f4bf-c2db-3af3-b713-ec3f3e899717@redcor.ch>
Permalink:  ../a356f4bf-c2db-3af3-b713-ec3f3e899717@redcor.ch/
Also on:    postgresql.org/message-id/a356f4bf-c2db-3af3-b713-ec3f3e899717@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
  Subject: Re: pg_restore has problems with restoring sequences.
  In-Reply-To: <a356f4bf-c2db-3af3-b713-ec3f3e899717@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