Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ihxmz-0005lC-Sl for pgsql-general@arkaria.postgresql.org; Thu, 19 Dec 2019 15:32:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ihxmy-0008NQ-Jj for pgsql-general@arkaria.postgresql.org; Thu, 19 Dec 2019 15:32:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ihxmy-0008Lu-3s for pgsql-general@lists.postgresql.org; Thu, 19 Dec 2019 15:32:32 +0000 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1ihxmv-00048c-KE for pgsql-general@lists.postgresql.org; Thu, 19 Dec 2019 15:32:30 +0000 Received: by mail-ot1-x331.google.com with SMTP id 66so7656453otd.9 for ; Thu, 19 Dec 2019 07:32:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=nqvGWNaRE30HPeULor9/9lAjmyR49uAkU/z0DUiEiNk=; b=f/477OjrybFobMDwZw8hHvZqMTOPBFvcmRlWD8XyKHPPF1sov7YenZtCDGbTVBYDpd K0bgMV1O7LINSL1zALRJ6yZzGW0rvDIr1u9CyxfuxQCVzJDfDQELZQtzdlrOBC3bw/+5 X70+PwIlg99vTlFINVKfwMBmt7OJXG2QU5NDY4NxCgmG2Vn+QhQYUMpkSJhP9U73m1vx EvWwDv5sYmr45gz6FCF2QPI3BNl2z3VgW8MidmrAEvMzZCjJQgdr2gPoze9dcRfv0w8m UwtWE6vbJfiB6EGa90i7Zu1Sti4nBMJ4I76OM6C8gGDbqNYVjYIi9s6t09JIkGf4qxQb B/ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=nqvGWNaRE30HPeULor9/9lAjmyR49uAkU/z0DUiEiNk=; b=mpeHe/PZKB9WUuidHi43O9CBDnd8LbSbr6RtkAG+gzA62EgLCrURx1EHt6zCGMT/Sn LEIS32tO+q+Xevn0+Z4tuiSbvaUvrLXqA1DuJqXlxnxqChONfu8IqVeBJWxMqhqPiUYp R9bEpHgX/1/tZPoq0CYDu6KXG2lgV8K5yIDvL49vNW2RCO6LAoGDUGSm4iCa+KDe2hrC YwKYjV+vkCEE2ygEwM/TomNST/oaE3E0J+muRZfFOnYGgcHdKgpsxH8gPHEhHntvJEMq I5dqrPns9ViZFe+LoNPmplLl3Nq4vrG6542QnQ1QTw9htKkMSx6/6xcbwCZuXCVwi5ot MzYw== X-Gm-Message-State: APjAAAVTnd9dBidsVE2ab8nowOnwJEu8Mk3G+pMvitI3dQ6zDCWQXiXk xVivSkT1kdxpi+BHl+uIb+0s8r+MuPQ= X-Google-Smtp-Source: APXvYqz2Y9oTWPJjfL+QI9zDned4YEuMh+YeTn8wRP1cGFiR/VZaq0VTvHMPfKFHQuxE/uUgRo7N0w== X-Received: by 2002:a05:6830:1607:: with SMTP id g7mr9506308otr.320.1576769548420; Thu, 19 Dec 2019 07:32:28 -0800 (PST) Received: from [192.168.1.10] (ip70-186-126-197.no.no.cox.net. [70.186.126.197]) by smtp.googlemail.com with ESMTPSA id n25sm2089024oic.6.2019.12.19.07.32.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Dec 2019 07:32:27 -0800 (PST) Subject: Re: Experiencing error during restore - found unexpected block ID (0) To: pgsql-general@lists.postgresql.org References: <3SH.IAqA.7kkLeDppu}m.1TzyBS@seznam.cz> <21efb6c3-bdb7-63be-4ea5-1e55e2439bc0@aklaver.com> <5zA.IAqP.6d9s3qsZ528.1T{vO}@seznam.cz> From: Ron Message-ID: <0e540a53-da1b-a605-699c-181adcfbb53b@gmail.com> Date: Thu, 19 Dec 2019 09:32:26 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <5zA.IAqP.6d9s3qsZ528.1T{vO}@seznam.cz> Content-Type: multipart/alternative; boundary="------------9C5EF895F6EFEE4C25100B9C" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk This is a multi-part message in MIME format. --------------9C5EF895F6EFEE4C25100B9C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit It's typically recommended that you use the pg_dump of the same version as the pg_restore.  In your case, the v12 pg_dump *will* successfully read from a 10.1 database. On 12/19/19 9:24 AM, Sar wrote: > for pg_dump it is: PostgreSQL 10.1, compiled by Visual C++ build 1800, 64-bit > for pg_restore it is the same machine as well as newest version of > Postgresql 12, so I assume the error is in pg_dump. > selects work no problem, I even dumped one table with COPY and it doesnt > raise any issue. The other table however is probably too big to ever do this. > schema for one table: > CREATE TABLE table1 ( >     foreign_id integer, >     action character varying(10), >     numarr smallint[] > ); > > and other table: > CREATE TABLE log ( >     id integer NOT NULL, >     place character varying(50), >     place_no integer, >     "time" character varying(80), >     action character varying(100), >     "user" character varying(50), >     place_definition character varying(10), >     place_definition2 character varying(50), >     place_definition3 character varying(30) > ); > > ---------- Původní e-mail ---------- > Od: Adrian Klaver > Komu: Sar , pgsql-general@postgresql.org > Datum: 17. 12. 2019 7:39:39 > Předmět: Re: Experiencing error during restore - found unexpected block ID > (0) > > > On 12/16/19 9:46 AM, Sar wrote: > > Hi, > > I have database on Windows Server, running postgresql 10 and I've run > > pg_dump with options: -Fc  --verbose -d db_name --file "E:\backup.sql" > > -T some_table. > > Now when I run pg_restore, also on windows server with postgresql > 12, or > > on the same original server with postgresql 10, using options > > --data-only --verbose -j 8, > > or without jobs, but selecting some specific few tables with -t > option I > > get follwing error: > > Which Postgres version of pg_dump/pg_restore are you using to do above? > > > error: pg_restore: error: found unexpected block ID (0) when reading > > data -- expected 3142 > > This error will only happen on very few tables, most run fine. > > What happens if you SELECT from these tables in the Postgres 10 instance? > > Can you show the schema definition for one or more of the problem tables? > > > Currently, I'm running without jobs and without tables selected with > -t, > > however I haven't gotten to the specific table that causes the trouble > > (the restore will take days), however I already fear when it comes to > > that table the same error will trigger. > > I guess this could serve as a possible bug report as well, but any > > advice as to what I can do is appreciated. > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > -- Angular momentum makes the world go 'round. --------------9C5EF895F6EFEE4C25100B9C Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit It's typically recommended that you use the pg_dump of the same version as the pg_restore.  In your case, the v12 pg_dump will successfully read from a 10.1 database.

On 12/19/19 9:24 AM, Sar wrote:
for pg_dump it is: PostgreSQL 10.1, compiled by Visual C++ build 1800, 64-bit
for pg_restore it is the same machine as well as newest version of Postgresql 12, so I assume the error is in pg_dump.
selects work no problem, I even dumped one table with COPY and it doesnt raise any issue. The other table however is probably too big to ever do this. 
schema for one table: 
CREATE TABLE table1 (
    foreign_id integer,
    action character varying(10),
    numarr smallint[]
);

and other table:
CREATE TABLE log (
    id integer NOT NULL,
    place character varying(50),
    place_no integer,
    "time" character varying(80),
    action character varying(100),
    "user" character varying(50),
    place_definition character varying(10),
    place_definition2 character varying(50),
    place_definition3 character varying(30)
);


On 12/16/19 9:46 AM, Sar wrote:
> Hi,
> I have database on Windows Server, running postgresql 10 and I've run
> pg_dump with options: -Fc  --verbose -d db_name --file "E:\backup.sql"
> -T some_table.
> Now when I run pg_restore, also on windows server with postgresql 12, or
> on the same original server with postgresql 10, using options
> --data-only --verbose -j 8,
> or without jobs, but selecting some specific few tables with -t option I
> get follwing error:

Which Postgres version of pg_dump/pg_restore are you using to do above?

> error: pg_restore: error: found unexpected block ID (0) when reading
> data -- expected 3142
> This error will only happen on very few tables, most run fine.

What happens if you SELECT from these tables in the Postgres 10 instance?

Can you show the schema definition for one or more of the problem tables?

> Currently, I'm running without jobs and without tables selected with -t,
> however I haven't gotten to the specific table that causes the trouble
> (the restore will take days), however I already fear when it comes to
> that table the same error will trigger.
> I guess this could serve as a possible bug report as well, but any
> advice as to what I can do is appreciated.


--
Adrian Klaver
adrian.klaver@aklaver.com

--
Angular momentum makes the world go 'round.
--------------9C5EF895F6EFEE4C25100B9C--