Re: pg_restore fails with a custom backup file

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Yoshiyuki Asaba <y-asaba(at)sraoss(dot)co(dot)jp>
Cc: ZeugswetterA(at)spardat(dot)at, andrew(at)dunslane(dot)net, z-saito(at)guitar(dot)ocn(dot)ne(dot)jp, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_restore fails with a custom backup file
Date: 2007-02-17 11:59:11
Message-ID: 45D6EE0F.2040806@hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Yoshiyuki Asaba wrote:
> From: Magnus Hagander <magnus(at)hagander(dot)net>
> Subject: Re: [HACKERS] pg_restore fails with a custom backup file
> Date: Fri, 16 Feb 2007 10:13:35 +0100
>
>> On Fri, Feb 16, 2007 at 02:09:41PM +0900, Yoshiyuki Asaba wrote:
>>
>>>>> Does not compile on my MinGW - errors in the system headers (unistd.h,
>>>>> io.h) due to changing the argument format for chsize(). The change of
>>>>> off_t propagated into parts of the system headers, thus chaos was
>>>>> ensured.
>>>>>
>>>>> I still think we need to use a pgoff_t. Will look at combining these two
>>>>> approaches.
>>>> Here's a patch that tries this.
>>>> *needs more testing*. But built with this patch, I can dump and
>>>> restore a table at the end of a 10gb database without errors.
>>> I tried the attached patch. But I got the following error.
>>>
>>> pg_backup_archiver.o(.text+0x1fa4): In function `allocAH':
>>> C:/msys/1.0/home/y-asaba/postgresql-8.2.3-patch/src/bin/pg_dump/pg_backup_archiver.c:1580: undefined reference to `fseeko64'
>>> ...
>>> make[3]: *** [pg_dump] Error 1
>>>
>>> $ uname -sr
>>> MINGW32_NT-5.1 1.0.10(0.46/3/2)
>>>
>>> Is MINGW version too old?
>> I think so. It seems this was added in version 1.24 of stdio.h in mingw
>> (http://cygwin.com/cgi-bin/cvsweb.cgi/src/winsup/mingw/include/stdio.h?cvsroot=src).
>> Could you try upgrading mingw and see if that helps? Or possibly
>> instlaling side-by-side a different version (if they even allow that)?
>
> OK. I have upgraded mingw and tried to compile. regression tests
> passed. So I tested pg_restore on Windows and Linux.
>
> $ createdb test
> $ pgbench -i -s 1000 test
> $ pg_dump -Fc test > out
> $ createdb restore
> $ pg_restore -d restore out
> $ psql -c 'select max(aid) from accounts' restore
> max
> -----------
> 100000000
> (1 row)
>
> pg_restore was normally completed. Thank you for your great work. I wish
> that the patch will be committed.

Thanks for running those tests. I need to test the msvc build as well,
but I can hopefully do that quickly. (and a few tests that I didn't
break unix)

I'd also like a comment from at least one other "patch reviewer" that
the methods used are good.

//Magnus

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lukas Kahwe Smith 2007-02-17 12:35:08 Re: wishlist items ..
Previous Message Yoshiyuki Asaba 2007-02-17 11:31:12 Re: pg_restore fails with a custom backup file