Re: pg_restore fails with a custom backup file

Поиск
Список
Период
Сортировка
От Yoshiyuki Asaba
Тема Re: pg_restore fails with a custom backup file
Дата
Msg-id 20061219.215905.74737747.y-asaba@sraoss.co.jp
обсуждение исходный текст
Ответ на Re: pg_restore fails with a custom backup file  ("Hiroshi Saito" <z-saito@guitar.ocn.ne.jp>)
Ответы Re: pg_restore fails with a custom backup file  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
Hi,

From: "Hiroshi Saito" <z-saito@guitar.ocn.ne.jp>
Subject: Re: [HACKERS] pg_restore fails with a custom backup file
Date: Fri, 15 Dec 2006 00:57:50 +0900

> > Win32 does not implement fseeko() and ftello(). So I think it limit to
> > handle a 2GB file. Is this a specification?
> 
> 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...

Is it able to use fsetpos()/fgetpos() instead of ftell()/fseek()?
fpos_t is a 8byte type. I tested pg_dump/pg_restore with the attached
patch.

--
Yoshiyuki Asaba
y-asaba@sraoss.co.jp
Index: src/include/c.h
===================================================================
RCS file: /projects/cvsroot/pgsql/src/include/c.h,v
retrieving revision 1.214
diff -c -r1.214 c.h
*** src/include/c.h    4 Oct 2006 00:30:06 -0000    1.214
--- src/include/c.h    19 Dec 2006 12:52:05 -0000
***************
*** 74,79 ****
--- 74,82 ---- #include <strings.h> #endif #include <sys/types.h>
+ #ifdef WIN32
+ #define off_t fpos_t
+ #endif  #include <errno.h> #if defined(WIN32) || defined(__CYGWIN__)
Index: src/include/port.h
===================================================================
RCS file: /projects/cvsroot/pgsql/src/include/port.h,v
retrieving revision 1.106
diff -c -r1.106 port.h
*** src/include/port.h    28 Nov 2006 01:12:33 -0000    1.106
--- src/include/port.h    19 Dec 2006 12:52:05 -0000
***************
*** 307,313 **** extern char *crypt(const char *key, const char *setting); #endif 
! #if defined(bsdi) || defined(netbsd) extern int    fseeko(FILE *stream, off_t offset, int whence); extern off_t
ftello(FILE*stream); #endif
 
--- 307,313 ---- extern char *crypt(const char *key, const char *setting); #endif 
! #if defined(bsdi) || defined(netbsd) || defined(WIN32) extern int    fseeko(FILE *stream, off_t offset, int whence);
externoff_t ftello(FILE *stream); #endif
 
Index: src/include/port/win32.h
===================================================================
RCS file: /projects/cvsroot/pgsql/src/include/port/win32.h,v
retrieving revision 1.63
diff -c -r1.63 win32.h
*** src/include/port/win32.h    19 Oct 2006 20:03:08 -0000    1.63
--- src/include/port/win32.h    19 Dec 2006 12:52:05 -0000
***************
*** 20,25 ****
--- 20,27 ---- #include <sys/utime.h>            /* for non-unicode version */ #undef near 
+ #define HAVE_FSEEKO
+  /* Must be here to avoid conflicting with prototype in windows.h */ #define mkdir(a,b)    mkdir(a) 
Index: src/port/fseeko.c
===================================================================
RCS file: /projects/cvsroot/pgsql/src/port/fseeko.c,v
retrieving revision 1.20
diff -c -r1.20 fseeko.c
*** src/port/fseeko.c    5 Mar 2006 15:59:10 -0000    1.20
--- src/port/fseeko.c    19 Dec 2006 12:52:06 -0000
***************
*** 17,23 ****  * We have to use the native defines here because configure hasn't  * completed yet.  */
! #if defined(__bsdi__) || defined(__NetBSD__)  #include "c.h" 
--- 17,23 ----  * We have to use the native defines here because configure hasn't  * completed yet.  */
! #if defined(__bsdi__) || defined(__NetBSD__) || defined(WIN32)  #include "c.h"

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCHES] Enums patch v2
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: small pg_dump RFE: new --no-prompt (password) option