Re: pg_restore fails with a custom backup file

Поиск
Список
Период
Сортировка
От Magnus Hagander
Тема Re: pg_restore fails with a custom backup file
Дата
Msg-id 20061218151436.GB6593@svr2.hagander.net
обсуждение исходный текст
Ответ на Re: pg_restore fails with a custom backup file  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: pg_restore fails with a custom backup file  (Andrew Dunstan <andrew@dunslane.net>)
Re: pg_restore fails with a custom backup file  (Dave Page <dpage@postgresql.org>)
Список pgsql-hackers
On Mon, Dec 18, 2006 at 09:50:12AM -0500, Bruce Momjian wrote:

> > > Yes, Magnus-san suggested the problem. It is present TODO.  The entire
> > > adjustment was still difficult though I had tried it. SetFilePointer might
> > > be able to be saved. However, I think it might be an attempt of 8.3...
> >
> > I've been looking at a fix for this, and I think I have it. The solution
> > looks to be to redefine off_t to 64-bit (the standard headers *always*
> > define it as 32-bit, and there is no way to change that - at least not
> > that I can find).
> >
> > I have the fix made for just bin/pg_dump for now (in pg_dump.h), and I'm
> > testing that. (So far only on MSVC builds)
> >
> > A question though - is there any *gain* from using 64-bit offsets in the
> > actual backend? The change could of course be done in port.h, but that
>
> No, not really.  All files are kept < 1gig for the backend.  We had code
> for that from Berkeley, so we have just kept it.

Ok, based on this, here's a patch that *appears* to fix the problem on
Win32. I tried the suggested repro to dump a pgbench database of
appropriate size, and it does restore properly and give me the proper
amount of rows in all the tables. But that's all I've tested so far.

Also, it compiles fine on MSVC. I still haven't managed to get the MingW
build environment working properly on Win64 even for building Win32
apps, so I haven't been able to build it on MingW yet. It *should* work
since it's all standard functions, but might require further hacks. I'll
try to get around to that later, and Dave has promised to give it a
compile-try as well, but if someone wants to test that, please do ;)

So, does it seem reasonable, and the right place to stick it? Oh, and
please do *not* apply until someone confirms it works on mingw!

//Magnus


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Hiroshi Saito"
Дата:
Сообщение: Re: pg_restore fails with a custom backup file
Следующее
От: "Albe Laurenz"
Дата:
Сообщение: Re: unixware and --with-ldap