Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eiMRm-0007iJ-QJ for pgsql-admin@arkaria.postgresql.org; Sun, 04 Feb 2018 15:43:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eiMRl-0005do-T5 for pgsql-admin@arkaria.postgresql.org; Sun, 04 Feb 2018 15:43:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eiMRl-0005de-Lv for pgsql-admin@lists.postgresql.org; Sun, 04 Feb 2018 15:43:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eiMRh-0007AA-PO for pgsql-admin@postgresql.org; Sun, 04 Feb 2018 15:43:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w14Fh6pw015767; Sun, 4 Feb 2018 10:43:06 -0500 From: Tom Lane To: robert cc: pgsql-admin@postgresql.org Subject: Re: pg_restore has problems with restoring sequences. In-reply-to: <129cd073-60bf-96db-e129-24bd9a37319e@redcor.ch> References: <129cd073-60bf-96db-e129-24bd9a37319e@redcor.ch> Comments: In-reply-to robert message dated "Sun, 04 Feb 2018 16:10:27 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <15765.1517758986.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Sun, 04 Feb 2018 10:43:06 -0500 Message-ID: <15766.1517758986@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk robert writes: > I use > =C2=A0=C2=A0=C2=A0 pg_dump -h localhost=C2=A0 -U USER -Fc DATABASE > du= mpfile OK ... > then I restore it with: > =C2=A0=C2=A0=C2=A0 dropdb DATABASE > =C2=A0=C2=A0=C2=A0 pg_restore -O=C2=A0 -U user=C2=A0 -d DATABASE=C2=A0 = dumpfile That sequence is missing a createdb step (or else -C in the restore switches). > doing this then I get these warnings, and many (not all) sequences are n= ot 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. regards, tom lane