Re: pg_restore fails with a custom backup file

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: pg_restore fails with a custom backup file
Дата
Msg-id 4586D2DD.4040906@dunslane.net
обсуждение исходный текст
Ответ на Re: pg_restore fails with a custom backup file  (Magnus Hagander <magnus@hagander.net>)
Ответы Re: pg_restore fails with a custom backup file  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
Magnus Hagander wrote:
> Index: src/bin/pg_dump/pg_dump.h
> ===================================================================
> RCS file: /projects/cvsroot/pgsql/src/bin/pg_dump/pg_dump.h,v
> retrieving revision 1.130
> diff -c -r1.130 pg_dump.h
> *** src/bin/pg_dump/pg_dump.h    9 Oct 2006 23:36:59 -0000    1.130
> --- src/bin/pg_dump/pg_dump.h    18 Dec 2006 14:33:16 -0000
> ***************
> *** 16,21 ****
> --- 16,33 ----
>   
>   #include "postgres_fe.h"
>   
> + #ifdef WIN32
> + /*
> +  * WIN32 does not provide a 64-bit off_t, but it does provide functions operating
> +  * with 64-bit offsets. Redefine off_t to what's always a 64-bit int, and redefine
> +  * the functions that accept off_t to be the 64-bit only ones.
> +  */
> + #define off_t __int64
> + #undef fseeko
> + #define fseeko(stream, offset, origin) _fseeki64(stream, offset, origin)
> + #undef ftello
> + #define ftello(stream) _ftelli64(stream)
> + #endif
>   
>   /*
>    * pg_dump uses two different mechanisms for identifying database objects:
>   

This patch appears to be broken on my MinGW setup:

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline 
-Wdeclaration-after-statement -Wendif-labels -fno-strict-aliasing -g 
-DFRONTEND -I../../../src/interfaces/libpq -I../.
./../src/include -I./src/include/port/win32 -DEXEC_BACKEND  
-I/c/tcl/include "-I../../../src/include/port/win32"  -c -o common.o 
common.c -MMD -MP -MF .deps/common.Po
In file included from 
c:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/zconf.h:289,                from 
c:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/zlib.h:34,                from pg_backup_archiver.h:44,
        from common.c:20:
 
c:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/unistd.h:23: 
error: conflicting types for 'chsize'
c:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/io.h:271: 
error: previous declaration of 'chsize' was here
c:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/unistd.h:23: 
error: conflicting types for 'chsize'
c:/mingw/bin/../lib/gcc/mingw32/3.4.2/../../../../include/io.h:271: 
error: previous declaration of 'chsize' was here


I suspect we might need to create a pg_off_t type or some such gadget.

Bleah.

But it does need to be fixed.

cheers

andrew




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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: pg_restore fails with a custom backup file
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: pg_restore fails with a custom backup file