Thread: Win32 tablespace
The attached patch implements a symlink for win32 using junctions, and uses that for win32 tablespaces. Regards, Andreas Index: tablespace.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/commands/tablespace.c,v retrieving revision 1.7 diff -u -r1.7 tablespace.c --- tablespace.c 1 Aug 2004 20:30:48 -0000 1.7 +++ tablespace.c 5 Aug 2004 13:36:48 -0000 @@ -77,6 +77,113 @@ static bool directory_is_empty(const char *path); + +#ifdef WIN32 + +#define symlink pgsymlink +#define HAVE_SYMLINK + +#include "winioctl.h" + +int pgsymlink(const char *oldpath, const char *newpath); + + +/* + * This struct is a replacement for REPARSE_DATA_BUFFER which is defined in VC6 winnt.h + * but omitted in later SDK functions. + * We only need the SymbolicLinkReparseBuffer part of the original struct's union. + */ +typedef struct +{ + DWORD ReparseTag; + WORD ReparseDataLength; + WORD Reserved; + /* SymbolicLinkReparseBuffer */ + WORD SubstituteNameOffset; + WORD SubstituteNameLength; + WORD PrintNameOffset; + WORD PrintNameLength; + WCHAR PathBuffer[1]; +} +REPARSE_JUNCTION_DATA_BUFFER; + +#define REPARSE_JUNCTION_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_JUNCTION_DATA_BUFFER, SubstituteNameOffset) + + +int +pgsymlink(const char *oldpath, const char *newpath) +{ + HANDLE dirhandle; + DWORD len; + + char buffer[MAX_PATH*sizeof(WCHAR) + sizeof(REPARSE_JUNCTION_DATA_BUFFER)]; + char nativeTarget[MAX_PATH]; + REPARSE_JUNCTION_DATA_BUFFER *reparseBuf = (REPARSE_JUNCTION_DATA_BUFFER*)buffer; + + CreateDirectory(newpath, 0); + dirhandle = CreateFile(newpath, GENERIC_READ|GENERIC_WRITE, + 0, 0, OPEN_EXISTING, + FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, 0); + + if (dirhandle == INVALID_HANDLE_VALUE) + return -1; + + /* make sure we have an unparsed native win32 path */ + if (memcmp("\\??\\", oldpath, 4)) + sprintf(nativeTarget, "\\??\\%s", oldpath); + else + strcpy(nativeTarget, oldpath); + + char *p=nativeTarget; + while ((p=strchr(p, '/')) != 0) + *p++ = '\\'; + + len = strlen(nativeTarget) * sizeof(WCHAR); + reparseBuf->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT; + reparseBuf->ReparseDataLength = len + 12; + reparseBuf->Reserved = 0; + reparseBuf->SubstituteNameOffset = 0; + reparseBuf->SubstituteNameLength = len; + reparseBuf->PrintNameOffset = len+sizeof(WCHAR); + reparseBuf->PrintNameLength = 0; + MultiByteToWideChar(CP_ACP, 0, nativeTarget, -1, + reparseBuf->PathBuffer, MAX_PATH); + + /* + * FSCTL_SET_REPARSE_POINT is coded differently depending on SDK version; + * we use our own definition + */ + if( !DeviceIoControl(dirhandle, + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_ANY_ACCESS), + reparseBuf, + reparseBuf->ReparseDataLength + REPARSE_JUNCTION_DATA_BUFFER_HEADER_SIZE, + 0, 0, &len, 0)) + { + LPSTR msg; + errno=0; + FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&msg, 0, NULL ); + ereport(ERROR, + (errcode_for_file_access(), + errmsg("Error setting junction for %s: %s", + nativeTarget, msg))); + + LocalFree(msg); + + CloseHandle(dirhandle); + RemoveDirectory(newpath); + return -1; + } + + CloseHandle(dirhandle); + + return 0; +} +#endif + + /* * Each database using a table space is isolated into its own name space * by a subdirectory named for the database OID. On first creation of an @@ -482,11 +589,19 @@ errmsg("could not unlink file \"%s\": %m", subfile))); +#ifdef WIN32 + if (rmdir(location) < 0) + ereport(ERROR, + (errcode_for_file_access(), + errmsg("could not remove junction dir \"%s\": %m", + location))); +#else if (unlink(location) < 0) ereport(ERROR, (errcode_for_file_access(), errmsg("could not unlink symbolic link \"%s\": %m", location))); +#endif pfree(subfile); pfree(location);
Andreas Pflug wrote: > The attached patch implements a symlink for win32 using junctions, and > uses that for win32 tablespaces. Wow, that's, uh, amazing! -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
Bruce Momjian wrote: > Andreas Pflug wrote: > >>The attached patch implements a symlink for win32 using junctions, and >>uses that for win32 tablespaces. > > > Wow, that's, uh, amazing! http://www.codeproject.com/w2k/junctionpoints.asp has a good description of the obfuscated REPARSE_DATA_BUFFER which is included in my vc6 installation, but not sufficiently documented. Regards, Andreas
> -----Original Message----- > From: pgsql-patches-owner@postgresql.org > [mailto:pgsql-patches-owner@postgresql.org] On Behalf Of Andreas Pflug > Sent: 05 August 2004 20:23 > To: Bruce Momjian > Cc: PostgreSQL Patches > Subject: Re: [PATCHES] Win32 tablespace > > Bruce Momjian wrote: > > Andreas Pflug wrote: > > > >>The attached patch implements a symlink for win32 using > junctions, and > >>uses that for win32 tablespaces. > > > > > > Wow, that's, uh, amazing! > > http://www.codeproject.com/w2k/junctionpoints.asp has a good > description of the obfuscated REPARSE_DATA_BUFFER which is > included in my vc6 installation, but not sufficiently documented. I concur with Bruce - nice work. This is obviously win2k+ only though - until now we've tried to support NT4 as well, although it seems that we can't get initdb to work as we'd like in the installer on that platform. Should we officially support 2K+ only? Regards, Dave.
Dave Page wrote: > > This is obviously win2k+ only though - There's a chance it might work on NT4 with >=SP4, because AFAIR the updated NTFS driver already understands the W2K format. > until now we've tried to support NT4 as well, although it seems that we > can't get initdb to work as we'd like in the installer on that platform. > Should we officially support 2K+ only? Since NT4 isn't supported by M$ for quite some time now, it seems reasonable to mark it as "does run with issues, but not officially supported". The installer would have to skip initdb, and display a lengthy read-carefully-readme how to continue manually. Regards, Andreas
> -----Original Message----- > From: Andreas Pflug [mailto:pgadmin@pse-consulting.de] > Sent: 06 August 2004 11:07 > To: Dave Page > Cc: Bruce Momjian; PostgreSQL Patches > Subject: Re: [PATCHES] Win32 tablespace > > Since NT4 isn't supported by M$ for quite some time now, it > seems reasonable to mark it as "does run with issues, but not > officially supported". The installer would have to skip > initdb, and display a lengthy read-carefully-readme how to > continue manually. Ahh, one of those things none of us read :-) /D
OK, applied. I moved the funciton into port/dirmod.c and cleaned up the interface for Win32. Would someone test this on Win32 in case I broke something? Patch attached. --------------------------------------------------------------------------- Andreas Pflug wrote: > The attached patch implements a symlink for win32 using junctions, and > uses that for win32 tablespaces. > > Regards, > Andreas > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 Index: src/include/port.h =================================================================== RCS file: /cvsroot/pgsql-server/src/include/port.h,v retrieving revision 1.47 diff -c -c -r1.47 port.h *** src/include/port.h 1 Aug 2004 06:56:39 -0000 1.47 --- src/include/port.h 7 Aug 2004 21:36:14 -0000 *************** *** 80,86 **** extern int find_my_exec(const char *argv0, char *retpath); extern int find_other_exec(const char *argv0, const char *target, const char *versionstr, char *retpath); ! #if defined(__CYGWIN__) || defined(WIN32) #define EXE ".exe" #define DEVNULL "nul" #else --- 80,86 ---- extern int find_my_exec(const char *argv0, char *retpath); extern int find_other_exec(const char *argv0, const char *target, const char *versionstr, char *retpath); ! #if defined(WIN32) || defined(__CYGWIN__) #define EXE ".exe" #define DEVNULL "nul" #else *************** *** 140,153 **** extern int pclose_check(FILE *stream); ! #if defined(__MINGW32__) || defined(__CYGWIN__) /* ! * Win32 doesn't have reliable rename/unlink during concurrent access */ extern int pgrename(const char *from, const char *to); extern int pgunlink(const char *path); ! #define rename(from, to) pgrename(from, to) ! #define unlink(path) pgunlink(path) #endif extern bool rmtree(char *path, bool rmtopdir); --- 140,156 ---- extern int pclose_check(FILE *stream); ! #if defined(WIN32) || defined(__CYGWIN__) /* ! * Win32 doesn't have reliable rename/unlink during concurrent access, ! * and we need special code to do symlinks. */ extern int pgrename(const char *from, const char *to); extern int pgunlink(const char *path); ! extern int pgsymlink(const char *oldpath, const char *newpath); ! #define rename(from, to) pgrename(from, to) ! #define unlink(path) pgunlink(path) ! #define symlink(oldpath, newpath) pgsymlink(oldpath, newpath) #endif extern bool rmtree(char *path, bool rmtopdir); Index: src/port/dirmod.c =================================================================== RCS file: /cvsroot/pgsql-server/src/port/dirmod.c,v retrieving revision 1.13 diff -c -c -r1.13 dirmod.c *** src/port/dirmod.c 1 Aug 2004 06:19:26 -0000 1.13 --- src/port/dirmod.c 7 Aug 2004 21:36:19 -0000 *************** *** 33,42 **** --- 33,46 ---- #include "miscadmin.h" + #include <winioctl.h> #undef rename #undef unlink + /* + * pgrename + */ int pgrename(const char *from, const char *to) { *************** *** 79,84 **** --- 83,91 ---- } + /* + * pgunlink + */ int pgunlink(const char *path) { *************** *** 110,121 **** return 0; } #endif #if defined(WIN32) || defined(__CYGWIN__) ! #define rmt_unlink(path) pgunlink(path) ! #else ! #define rmt_unlink(path) unlink(path) #endif #ifdef FRONTEND --- 117,235 ---- return 0; } + + /* + * pgsymlink support: + * + * This struct is a replacement for REPARSE_DATA_BUFFER which is defined in VC6 winnt.h + * but omitted in later SDK functions. + * We only need the SymbolicLinkReparseBuffer part of the original struct's union. + */ + typedef struct + { + DWORD ReparseTag; + WORD ReparseDataLength; + WORD Reserved; + /* SymbolicLinkReparseBuffer */ + WORD SubstituteNameOffset; + WORD SubstituteNameLength; + WORD PrintNameOffset; + WORD PrintNameLength; + WCHAR PathBuffer[1]; + } + REPARSE_JUNCTION_DATA_BUFFER; + + #define REPARSE_JUNCTION_DATA_BUFFER_HEADER_SIZE \ + FIELD_OFFSET(REPARSE_JUNCTION_DATA_BUFFER, SubstituteNameOffset) + + + /* + * pgsymlink - uses Win32 junction points + * + * For reference: http://www.codeproject.com/w2k/junctionpoints.asp + */ + int + pgsymlink(const char *oldpath, const char *newpath) + { + HANDLE dirhandle; + DWORD len; + char *p = nativeTarget; + char buffer[MAX_PATH*sizeof(WCHAR) + sizeof(REPARSE_JUNCTION_DATA_BUFFER)]; + char nativeTarget[MAX_PATH]; + REPARSE_JUNCTION_DATA_BUFFER *reparseBuf = (REPARSE_JUNCTION_DATA_BUFFER*)buffer; + + CreateDirectory(newpath, 0); + dirhandle = CreateFile(newpath, GENERIC_READ | GENERIC_WRITE, + 0, 0, OPEN_EXISTING, + FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, 0); + + if (dirhandle == INVALID_HANDLE_VALUE) + return -1; + + /* make sure we have an unparsed native win32 path */ + if (memcmp("\\??\\", oldpath, 4)) + sprintf(nativeTarget, "\\??\\%s", oldpath); + else + strcpy(nativeTarget, oldpath); + + while ((p = strchr(p, '/')) != 0) + *p++ = '\\'; + + len = strlen(nativeTarget) * sizeof(WCHAR); + reparseBuf->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT; + reparseBuf->ReparseDataLength = len + 12; + reparseBuf->Reserved = 0; + reparseBuf->SubstituteNameOffset = 0; + reparseBuf->SubstituteNameLength = len; + reparseBuf->PrintNameOffset = len+sizeof(WCHAR); + reparseBuf->PrintNameLength = 0; + MultiByteToWideChar(CP_ACP, 0, nativeTarget, -1, + reparseBuf->PathBuffer, MAX_PATH); + + /* + * FSCTL_SET_REPARSE_POINT is coded differently depending on SDK version; + * we use our own definition + */ + if (!DeviceIoControl(dirhandle, + CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 41, METHOD_BUFFERED, FILE_ANY_ACCESS), + reparseBuf, + reparseBuf->ReparseDataLength + REPARSE_JUNCTION_DATA_BUFFER_HEADER_SIZE, + 0, 0, &len, 0)) + { + LPSTR msg; + + errno=0; + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPSTR)&msg, 0, NULL ); + ereport(ERROR, (errcode_for_file_access(), + errmsg("Error setting junction for %s: %s", nativeTarget, msg))); + + LocalFree(msg); + + CloseHandle(dirhandle); + RemoveDirectory(newpath); + return -1; + } + + CloseHandle(dirhandle); + + return 0; + } + #endif + + /* ---------------- + * rmtree routines + * ---------------- + */ + + + /* We undefined these above, so we redefine them */ #if defined(WIN32) || defined(__CYGWIN__) ! #define unlink(path) pgunlink(path) #endif #ifdef FRONTEND *************** *** 175,190 **** xfree(filenames); } - - /* ! * delete a directory tree recursively ! * assumes path points to a valid directory ! * deletes everything under path ! * if rmtopdir is true deletes the directory too * */ - bool rmtree(char *path, bool rmtopdir) { --- 289,303 ---- xfree(filenames); } /* ! * rmtree ! * ! * Delete a directory tree recursively. ! * Assumes path points to a valid directory. ! * Deletes everything under path. ! * If rmtopdir is true deletes the directory too. * */ bool rmtree(char *path, bool rmtopdir) { *************** *** 249,255 **** } else { ! if (rmt_unlink(filepath) != 0) { rmt_cleanup(filenames); return false; --- 362,368 ---- } else { ! if (unlink(filepath) != 0) { rmt_cleanup(filenames); return false;
Bruce Momjian wrote: > OK, applied. I moved the funciton into port/dirmod.c and cleaned up the > interface for Win32. > > Would someone test this on Win32 in case I broke something? Yes, something's broken, see patch. Second, HAVE_SYMLINK must be defined somewhere (configure?). Third, a junction is a directory, not a file, so DROP tablespace must use rmdir, not unlink to remove the junction; see my original patch. Regards, Andreas Index: dirmod.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/port/dirmod.c,v retrieving revision 1.14 diff -u -r1.14 dirmod.c --- dirmod.c 7 Aug 2004 21:48:09 -0000 1.14 +++ dirmod.c 7 Aug 2004 22:31:25 -0000 @@ -153,9 +153,9 @@ { HANDLE dirhandle; DWORD len; - char *p = nativeTarget; char buffer[MAX_PATH*sizeof(WCHAR) + sizeof(REPARSE_JUNCTION_DATA_BUFFER)]; char nativeTarget[MAX_PATH]; + char *p = nativeTarget; REPARSE_JUNCTION_DATA_BUFFER *reparseBuf = (REPARSE_JUNCTION_DATA_BUFFER*)buffer; CreateDirectory(newpath, 0); @@ -203,9 +203,12 @@ NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&msg, 0, NULL ); +#ifdef FRONTEND + fprintf(stderr, "Error setting junction for %s: %s", nativeTarget, msg); +#else ereport(ERROR, (errcode_for_file_access(), errmsg("Error setting junction for %s: %s", nativeTarget, msg))); - +#endif LocalFree(msg); CloseHandle(dirhandle);
OK, got them all. Thanks. Patch attached. Would someone retest on Win32? --------------------------------------------------------------------------- Andreas Pflug wrote: > Bruce Momjian wrote: > > OK, applied. I moved the funciton into port/dirmod.c and cleaned up the > > interface for Win32. > > > > Would someone test this on Win32 in case I broke something? > > Yes, something's broken, see patch. > > Second, HAVE_SYMLINK must be defined somewhere (configure?). > > Third, a junction is a directory, not a file, so DROP tablespace must > use rmdir, not unlink to remove the junction; see my original patch. > > Regards, > Andreas > > > > ---------------------------(end of broadcast)--------------------------- > TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 Index: configure =================================================================== RCS file: /cvsroot/pgsql-server/configure,v retrieving revision 1.381 diff -c -c -r1.381 configure *** configure 4 Aug 2004 21:33:34 -0000 1.381 --- configure 8 Aug 2004 00:45:33 -0000 *************** *** 12060,12066 **** LIBOBJS="$LIBOBJS gettimeofday.$ac_objext" LIBOBJS="$LIBOBJS kill.$ac_objext" LIBOBJS="$LIBOBJS open.$ac_objext" ! LIBOBJS="$LIBOBJS rand.$ac_objext" ;; esac if test "$with_readline" = yes; then --- 12060,12072 ---- LIBOBJS="$LIBOBJS gettimeofday.$ac_objext" LIBOBJS="$LIBOBJS kill.$ac_objext" LIBOBJS="$LIBOBJS open.$ac_objext" ! LIBOBJS="$LIBOBJS rand.$ac_objext" ! ! cat >>confdefs.h <<\_ACEOF ! #define HAVE_SYMLINK 1 ! _ACEOF ! ! ;; esac if test "$with_readline" = yes; then Index: configure.in =================================================================== RCS file: /cvsroot/pgsql-server/configure.in,v retrieving revision 1.371 diff -c -c -r1.371 configure.in *** configure.in 4 Aug 2004 21:33:35 -0000 1.371 --- configure.in 8 Aug 2004 00:45:37 -0000 *************** *** 908,914 **** AC_LIBOBJ(gettimeofday) AC_LIBOBJ(kill) AC_LIBOBJ(open) ! AC_LIBOBJ(rand) ;; esac if test "$with_readline" = yes; then --- 908,917 ---- AC_LIBOBJ(gettimeofday) AC_LIBOBJ(kill) AC_LIBOBJ(open) ! AC_LIBOBJ(rand) ! AC_DEFINE([HAVE_SYMLINK], 1, ! [Define to 1 if you have the `symlink' function.]) ! ;; esac if test "$with_readline" = yes; then Index: src/backend/commands/tablespace.c =================================================================== RCS file: /cvsroot/pgsql-server/src/backend/commands/tablespace.c,v retrieving revision 1.7 diff -c -c -r1.7 tablespace.c *** src/backend/commands/tablespace.c 1 Aug 2004 20:30:48 -0000 1.7 --- src/backend/commands/tablespace.c 8 Aug 2004 00:45:44 -0000 *************** *** 482,492 **** --- 482,501 ---- errmsg("could not unlink file \"%s\": %m", subfile))); + #ifndef WIN32 if (unlink(location) < 0) ereport(ERROR, (errcode_for_file_access(), errmsg("could not unlink symbolic link \"%s\": %m", location))); + #else + /* The junction is a directory, not a file */ + if (rmdir(location) < 0) + ereport(ERROR, + (errcode_for_file_access(), + errmsg("could not remove junction dir \"%s\": %m", + location))); + #endif pfree(subfile); pfree(location); Index: src/port/dirmod.c =================================================================== RCS file: /cvsroot/pgsql-server/src/port/dirmod.c,v retrieving revision 1.14 diff -c -c -r1.14 dirmod.c *** src/port/dirmod.c 7 Aug 2004 21:48:09 -0000 1.14 --- src/port/dirmod.c 8 Aug 2004 00:45:52 -0000 *************** *** 153,161 **** { HANDLE dirhandle; DWORD len; - char *p = nativeTarget; char buffer[MAX_PATH*sizeof(WCHAR) + sizeof(REPARSE_JUNCTION_DATA_BUFFER)]; char nativeTarget[MAX_PATH]; REPARSE_JUNCTION_DATA_BUFFER *reparseBuf = (REPARSE_JUNCTION_DATA_BUFFER*)buffer; CreateDirectory(newpath, 0); --- 153,161 ---- { HANDLE dirhandle; DWORD len; char buffer[MAX_PATH*sizeof(WCHAR) + sizeof(REPARSE_JUNCTION_DATA_BUFFER)]; char nativeTarget[MAX_PATH]; + char *p = nativeTarget; REPARSE_JUNCTION_DATA_BUFFER *reparseBuf = (REPARSE_JUNCTION_DATA_BUFFER*)buffer; CreateDirectory(newpath, 0); *************** *** 203,211 **** NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&msg, 0, NULL ); ereport(ERROR, (errcode_for_file_access(), errmsg("Error setting junction for %s: %s", nativeTarget, msg))); ! LocalFree(msg); CloseHandle(dirhandle); --- 203,214 ---- NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&msg, 0, NULL ); + #ifdef FRONTEND + fprintf(stderr, "Error setting junction for %s: %s", nativeTarget, msg); + #else ereport(ERROR, (errcode_for_file_access(), errmsg("Error setting junction for %s: %s", nativeTarget, msg))); ! #endif LocalFree(msg); CloseHandle(dirhandle);
I get a build failure (win 2000 pro): gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations zic.o ialloc.o scheck.o localtime.o -L../../src/port -lpgport -lwsock32 -lm -lws2_32 -o zic.exe ../../src/port/libpgport.a(dirmod.o)(.text+0xc6):dirmod.c: undefined reference to `pgwin32_backend_usleep' ../../src/port/libpgport.a(dirmod.o)(.text+0xe4):dirmod.c: undefined reference to `errstart' ../../src/port/libpgport.a(dirmod.o)(.text+0xf2):dirmod.c: undefined reference to `elog_finish' ../../src/port/libpgport.a(dirmod.o)(.text+0x11d):dirmod.c: undefined reference to `errstart' ../../src/port/libpgport.a(dirmod.o)(.text+0x12b):dirmod.c: undefined reference to `elog_finish' ../../src/port/libpgport.a(dirmod.o)(.text+0x1c3):dirmod.c: undefined reference to `pgwin32_backend_usleep' ../../src/port/libpgport.a(dirmod.o)(.text+0x1e1):dirmod.c: undefined reference to `errstart' ../../src/port/libpgport.a(dirmod.o)(.text+0x1f1):dirmod.c: undefined reference to `elog_finish' ../../src/port/libpgport.a(dirmod.o)(.text+0x21c):dirmod.c: undefined reference to `errstart' ../../src/port/libpgport.a(dirmod.o)(.text+0x22c):dirmod.c: undefined reference to `elog_finish' ../../src/port/libpgport.a(dirmod.o)(.text+0x459):dirmod.c: undefined reference to `errstart' ../../src/port/libpgport.a(dirmod.o)(.text+0x4aa):dirmod.c: undefined reference to `errmsg' ../../src/port/libpgport.a(dirmod.o)(.text+0x4b4):dirmod.c: undefined reference to `errcode_for_file_access' ../../src/port/libpgport.a(dirmod.o)(.text+0x4bc):dirmod.c: undefined reference to `errfinish' ../../src/port/libpgport.a(dirmod.o)(.text+0x51a):dirmod.c: undefined reference to `pfree' ../../src/port/libpgport.a(dirmod.o)(.text+0x5ea):dirmod.c: undefined reference to `_imp__CurrentMemoryContext' ../../src/port/libpgport.a(dirmod.o)(.text+0x5f2):dirmod.c: undefined reference to `MemoryContextAlloc' ../../src/port/libpgport.a(dirmod.o)(.text+0x64d):dirmod.c: undefined reference to `_imp__CurrentMemoryContext' ../../src/port/libpgport.a(dirmod.o)(.text+0x656):dirmod.c: undefined reference to `MemoryContextStrdup' ../../src/port/libpgport.a(dirmod.o)(.text+0x50a):dirmod.c: undefined reference to `pfree' make[2]: *** [zic] Error 1 make[2]: Leaving directory `/home/Administrator/develop/c/postgresql-8.0devel/src/timezone' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/Administrator/develop/c/postgresql-8.0devel/src' make: *** [all] Error 2 Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > OK, got them all. Thanks. Patch attached. > > Would someone retest on Win32? > > --------------------------------------------------------------------------- > > Andreas Pflug wrote: > > Bruce Momjian wrote: > > > OK, applied. I moved the funciton into port/dirmod.c and cleaned up the > > > interface for Win32. > > > > > > Would someone test this on Win32 in case I broke something? > > > > Yes, something's broken, see patch. > > > > Second, HAVE_SYMLINK must be defined somewhere (configure?). > > > > Third, a junction is a directory, not a file, so DROP tablespace must > > use rmdir, not unlink to remove the junction; see my original patch. > > > > Regards, > > Andreas > > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 2: you can get off all lists at once with the unregister command > > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 359-1001 > + If your life is a hard drive, | 13 Roberts Road > + Christ can be your backup. | Newtown Square, Pennsylvania 19073 >
OK, I have just applied a patch to src/timezone/Makefile which will fix this by compiling dirmod.c specially like we do in other Makefiles. Patch attached. --------------------------------------------------------------------------- markir@coretech.co.nz wrote: > I get a build failure (win 2000 pro): > > gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes -Wmissing-declarations > zic.o ialloc.o scheck.o localtime.o -L../../src/port -lpgport -lwsock32 -lm > -lws2_32 -o zic.exe > ../../src/port/libpgport.a(dirmod.o)(.text+0xc6):dirmod.c: undefined reference > to `pgwin32_backend_usleep' > ../../src/port/libpgport.a(dirmod.o)(.text+0xe4):dirmod.c: undefined reference > to `errstart' > ../../src/port/libpgport.a(dirmod.o)(.text+0xf2):dirmod.c: undefined reference > to `elog_finish' > ../../src/port/libpgport.a(dirmod.o)(.text+0x11d):dirmod.c: undefined reference > to `errstart' > ../../src/port/libpgport.a(dirmod.o)(.text+0x12b):dirmod.c: undefined reference > to `elog_finish' > ../../src/port/libpgport.a(dirmod.o)(.text+0x1c3):dirmod.c: undefined reference > to `pgwin32_backend_usleep' > ../../src/port/libpgport.a(dirmod.o)(.text+0x1e1):dirmod.c: undefined reference > to `errstart' > ../../src/port/libpgport.a(dirmod.o)(.text+0x1f1):dirmod.c: undefined reference > to `elog_finish' > ../../src/port/libpgport.a(dirmod.o)(.text+0x21c):dirmod.c: undefined reference > to `errstart' > ../../src/port/libpgport.a(dirmod.o)(.text+0x22c):dirmod.c: undefined reference > to `elog_finish' > ../../src/port/libpgport.a(dirmod.o)(.text+0x459):dirmod.c: undefined reference > to `errstart' > ../../src/port/libpgport.a(dirmod.o)(.text+0x4aa):dirmod.c: undefined reference > to `errmsg' > ../../src/port/libpgport.a(dirmod.o)(.text+0x4b4):dirmod.c: undefined reference > to `errcode_for_file_access' > ../../src/port/libpgport.a(dirmod.o)(.text+0x4bc):dirmod.c: undefined reference > to `errfinish' > ../../src/port/libpgport.a(dirmod.o)(.text+0x51a):dirmod.c: undefined reference > to `pfree' > ../../src/port/libpgport.a(dirmod.o)(.text+0x5ea):dirmod.c: undefined reference > to `_imp__CurrentMemoryContext' > ../../src/port/libpgport.a(dirmod.o)(.text+0x5f2):dirmod.c: undefined reference > to `MemoryContextAlloc' > ../../src/port/libpgport.a(dirmod.o)(.text+0x64d):dirmod.c: undefined reference > to `_imp__CurrentMemoryContext' > ../../src/port/libpgport.a(dirmod.o)(.text+0x656):dirmod.c: undefined reference > to `MemoryContextStrdup' > ../../src/port/libpgport.a(dirmod.o)(.text+0x50a):dirmod.c: undefined reference > to `pfree' > make[2]: *** [zic] Error 1 > make[2]: Leaving directory > `/home/Administrator/develop/c/postgresql-8.0devel/src/timezone' > make[1]: *** [all] Error 2 > make[1]: Leaving directory > `/home/Administrator/develop/c/postgresql-8.0devel/src' > make: *** [all] Error 2 > > > Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > > > OK, got them all. Thanks. Patch attached. > > > > Would someone retest on Win32? > > > > --------------------------------------------------------------------------- > > > > Andreas Pflug wrote: > > > Bruce Momjian wrote: > > > > OK, applied. I moved the funciton into port/dirmod.c and cleaned up the > > > > interface for Win32. > > > > > > > > Would someone test this on Win32 in case I broke something? > > > > > > Yes, something's broken, see patch. > > > > > > Second, HAVE_SYMLINK must be defined somewhere (configure?). > > > > > > Third, a junction is a directory, not a file, so DROP tablespace must > > > use rmdir, not unlink to remove the junction; see my original patch. > > > > > > Regards, > > > Andreas > > > > > > > > > > > > > > > > ---------------------------(end of broadcast)--------------------------- > > > TIP 2: you can get off all lists at once with the unregister command > > > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > > > > -- > > Bruce Momjian | http://candle.pha.pa.us > > pgman@candle.pha.pa.us | (610) 359-1001 > > + If your life is a hard drive, | 13 Roberts Road > > + Christ can be your backup. | Newtown Square, Pennsylvania 19073 > > > > > > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 Index: Makefile =================================================================== RCS file: /cvsroot/pgsql-server/src/timezone/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -c -c -r1.12 -r1.13 *** Makefile 28 May 2004 03:53:33 -0000 1.12 --- Makefile 8 Aug 2004 03:57:35 -0000 1.13 *************** *** 13,19 **** include $(top_builddir)/src/Makefile.global # files to build into backend ! OBJS= localtime.o strftime.o pgtz.o # files needed to build zic utility program ZICOBJS= zic.o ialloc.o scheck.o localtime.o --- 13,19 ---- include $(top_builddir)/src/Makefile.global # files to build into backend ! OBJS= localtime.o strftime.o pgtz.o dirmod.o # files needed to build zic utility program ZICOBJS= zic.o ialloc.o scheck.o localtime.o *************** *** 31,36 **** --- 31,39 ---- zic: $(ZICOBJS) $(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X) + dirmod.c: % : $(top_srcdir)/src/port/% + rm -f $@ && $(LN_S) $< . + install: all installdirs ./zic -d $(DESTDIR)$(datadir)/timezone $(TZDATAFILES) *************** *** 38,41 **** $(mkinstalldirs) $(DESTDIR)$(datadir) clean distclean maintainer-clean: ! rm -f SUBSYS.o zic $(OBJS) $(ZICOBJS) --- 41,44 ---- $(mkinstalldirs) $(DESTDIR)$(datadir) clean distclean maintainer-clean: ! rm -f SUBSYS.o zic $(OBJS) $(ZICOBJS) dirmod.c
Unfortunately I am still seeing the same error - I can "fix" it by with this: *** dirmod.c.orig Sun Aug 8 17:14:48 2004 --- dirmod.c Sun Aug 8 17:14:59 2004 *************** *** 15,20 **** --- 15,21 ---- *------------------------------------------------------------------------- */ + #define FRONTEND #ifndef FRONTEND #include "postgres.h" #else However using the same patch *solely* on the (copied) src/timezone/dirmod.c does *not* fix the issue - I wonder if the linker picking up dirmod.o from src/port instead of src/timezone? regards Mark Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > OK, I have just applied a patch to src/timezone/Makefile which will fix > this by compiling dirmod.c specially like we do in other Makefiles. > > Patch attached. > > --------------------------------------------------------------------------- > > markir@coretech.co.nz wrote: > > I get a build failure (win 2000 pro): > > > > gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes > -Wmissing-declarations > > zic.o ialloc.o scheck.o localtime.o -L../../src/port -lpgport -lwsock32 > -lm > > -lws2_32 -o zic.exe > > ../../src/port/libpgport.a(dirmod.o)(.text+0xc6):dirmod.c: undefined > reference > > to `pgwin32_backend_usleep' > > ../../src/port/libpgport.a(dirmod.o)(.text+0xe4):dirmod.c: undefined > reference > > to `errstart' > > ../../src/port/libpgport.a(dirmod.o)(.text+0xf2):dirmod.c: undefined > reference > > to `elog_finish' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x11d):dirmod.c: undefined > reference > > to `errstart' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x12b):dirmod.c: undefined > reference > > to `elog_finish' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1c3):dirmod.c: undefined > reference > > to `pgwin32_backend_usleep' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1e1):dirmod.c: undefined > reference > > to `errstart' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1f1):dirmod.c: undefined > reference > > to `elog_finish' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x21c):dirmod.c: undefined > reference > > to `errstart' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x22c):dirmod.c: undefined > reference > > to `elog_finish' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x459):dirmod.c: undefined > reference > > to `errstart' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4aa):dirmod.c: undefined > reference > > to `errmsg' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4b4):dirmod.c: undefined > reference > > to `errcode_for_file_access' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4bc):dirmod.c: undefined > reference > > to `errfinish' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x51a):dirmod.c: undefined > reference > > to `pfree' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x5ea):dirmod.c: undefined > reference > > to `_imp__CurrentMemoryContext' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x5f2):dirmod.c: undefined > reference > > to `MemoryContextAlloc' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x64d):dirmod.c: undefined > reference > > to `_imp__CurrentMemoryContext' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x656):dirmod.c: undefined > reference > > to `MemoryContextStrdup' > > ../../src/port/libpgport.a(dirmod.o)(.text+0x50a):dirmod.c: undefined > reference > > to `pfree' > > make[2]: *** [zic] Error 1 > > make[2]: Leaving directory > > `/home/Administrator/develop/c/postgresql-8.0devel/src/timezone' > > make[1]: *** [all] Error 2 > > make[1]: Leaving directory > > `/home/Administrator/develop/c/postgresql-8.0devel/src' > > make: *** [all] Error 2 > > > > > > Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > > > > > OK, got them all. Thanks. Patch attached. > > > > > > Would someone retest on Win32? > > > > > > > --------------------------------------------------------------------------- > > > > > > Andreas Pflug wrote: > > > > Bruce Momjian wrote: > > > > > OK, applied. I moved the funciton into port/dirmod.c and cleaned up > the > > > > > interface for Win32. > > > > > > > > > > Would someone test this on Win32 in case I broke something? > > > > > > > > Yes, something's broken, see patch. > > > > > > > > Second, HAVE_SYMLINK must be defined somewhere (configure?). > > > > > > > > Third, a junction is a directory, not a file, so DROP tablespace must > > > > use rmdir, not unlink to remove the junction; see my original patch. > > > > > > > > Regards, > > > > Andreas > > > > > > > > > > > > > > > > > > > > > > ---------------------------(end of > broadcast)--------------------------- > > > > TIP 2: you can get off all lists at once with the unregister command > > > > (send "unregister YourEmailAddressHere" to > majordomo@postgresql.org) > > > > > > -- > > > Bruce Momjian | http://candle.pha.pa.us > > > pgman@candle.pha.pa.us | (610) 359-1001 > > > + If your life is a hard drive, | 13 Roberts Road > > > + Christ can be your backup. | Newtown Square, Pennsylvania > 19073 > > > > > > > > > > > > > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 359-1001 > + If your life is a hard drive, | 13 Roberts Road > + Christ can be your backup. | Newtown Square, Pennsylvania 19073 >
I just committed the final fix for zic and Claudio has compiled it so please grab cvs head and give it a try. --------------------------------------------------------------------------- markir@coretech.co.nz wrote: > Unfortunately I am still seeing the same error - I can "fix" it by with this: > > *** dirmod.c.orig Sun Aug 8 17:14:48 2004 > --- dirmod.c Sun Aug 8 17:14:59 2004 > *************** > *** 15,20 **** > --- 15,21 ---- > *------------------------------------------------------------------------- > */ > > + #define FRONTEND > #ifndef FRONTEND > #include "postgres.h" > #else > > > However using the same patch *solely* on the (copied) src/timezone/dirmod.c does > *not* fix the issue - I wonder if the linker picking up dirmod.o from src/port > instead of src/timezone? > > regards > > Mark > > Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > > > > OK, I have just applied a patch to src/timezone/Makefile which will fix > > this by compiling dirmod.c specially like we do in other Makefiles. > > > > Patch attached. > > > > --------------------------------------------------------------------------- > > > > markir@coretech.co.nz wrote: > > > I get a build failure (win 2000 pro): > > > > > > gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes > > -Wmissing-declarations > > > zic.o ialloc.o scheck.o localtime.o -L../../src/port -lpgport -lwsock32 > > -lm > > > -lws2_32 -o zic.exe > > > ../../src/port/libpgport.a(dirmod.o)(.text+0xc6):dirmod.c: undefined > > reference > > > to `pgwin32_backend_usleep' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0xe4):dirmod.c: undefined > > reference > > > to `errstart' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0xf2):dirmod.c: undefined > > reference > > > to `elog_finish' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x11d):dirmod.c: undefined > > reference > > > to `errstart' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x12b):dirmod.c: undefined > > reference > > > to `elog_finish' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1c3):dirmod.c: undefined > > reference > > > to `pgwin32_backend_usleep' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1e1):dirmod.c: undefined > > reference > > > to `errstart' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1f1):dirmod.c: undefined > > reference > > > to `elog_finish' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x21c):dirmod.c: undefined > > reference > > > to `errstart' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x22c):dirmod.c: undefined > > reference > > > to `elog_finish' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x459):dirmod.c: undefined > > reference > > > to `errstart' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4aa):dirmod.c: undefined > > reference > > > to `errmsg' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4b4):dirmod.c: undefined > > reference > > > to `errcode_for_file_access' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4bc):dirmod.c: undefined > > reference > > > to `errfinish' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x51a):dirmod.c: undefined > > reference > > > to `pfree' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x5ea):dirmod.c: undefined > > reference > > > to `_imp__CurrentMemoryContext' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x5f2):dirmod.c: undefined > > reference > > > to `MemoryContextAlloc' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x64d):dirmod.c: undefined > > reference > > > to `_imp__CurrentMemoryContext' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x656):dirmod.c: undefined > > reference > > > to `MemoryContextStrdup' > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x50a):dirmod.c: undefined > > reference > > > to `pfree' > > > make[2]: *** [zic] Error 1 > > > make[2]: Leaving directory > > > `/home/Administrator/develop/c/postgresql-8.0devel/src/timezone' > > > make[1]: *** [all] Error 2 > > > make[1]: Leaving directory > > > `/home/Administrator/develop/c/postgresql-8.0devel/src' > > > make: *** [all] Error 2 > > > > > > > > > Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > > > > > > > OK, got them all. Thanks. Patch attached. > > > > > > > > Would someone retest on Win32? > > > > > > > > > > --------------------------------------------------------------------------- > > > > > > > > Andreas Pflug wrote: > > > > > Bruce Momjian wrote: > > > > > > OK, applied. I moved the funciton into port/dirmod.c and cleaned up > > the > > > > > > interface for Win32. > > > > > > > > > > > > Would someone test this on Win32 in case I broke something? > > > > > > > > > > Yes, something's broken, see patch. > > > > > > > > > > Second, HAVE_SYMLINK must be defined somewhere (configure?). > > > > > > > > > > Third, a junction is a directory, not a file, so DROP tablespace must > > > > > use rmdir, not unlink to remove the junction; see my original patch. > > > > > > > > > > Regards, > > > > > Andreas > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------(end of > > broadcast)--------------------------- > > > > > TIP 2: you can get off all lists at once with the unregister command > > > > > (send "unregister YourEmailAddressHere" to > > majordomo@postgresql.org) > > > > > > > > -- > > > > Bruce Momjian | http://candle.pha.pa.us > > > > pgman@candle.pha.pa.us | (610) 359-1001 > > > > + If your life is a hard drive, | 13 Roberts Road > > > > + Christ can be your backup. | Newtown Square, Pennsylvania > > 19073 > > > > > > > > > > > > > > > > > > > > -- > > Bruce Momjian | http://candle.pha.pa.us > > pgman@candle.pha.pa.us | (610) 359-1001 > > + If your life is a hard drive, | 13 Roberts Road > > + Christ can be your backup. | Newtown Square, Pennsylvania 19073 > > > > > > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
Hmmm...updated and tried to rebuild - I get the same error! It looks like I have the latest src/timezone/Makefile (1.14) The only thing I am doing that is a bit different perhaps is : - on Freebsd performing cvs update -d -P - followed by ./configure;make dist - copy the archive to win2000 and build (msys 1.0.10, mingw 3.0.1-1) regards Mark (I guess the next best thing for me to try is a *completely* fresh checkout...) Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > I just committed the final fix for zic and Claudio has compiled it so > please grab cvs head and give it a try. > > --------------------------------------------------------------------------- > > markir@coretech.co.nz wrote: > > Unfortunately I am still seeing the same error - I can "fix" it by with > this: > > > > *** dirmod.c.orig Sun Aug 8 17:14:48 2004 > > --- dirmod.c Sun Aug 8 17:14:59 2004 > > *************** > > *** 15,20 **** > > --- 15,21 ---- > > > *------------------------------------------------------------------------- > > */ > > > > + #define FRONTEND > > #ifndef FRONTEND > > #include "postgres.h" > > #else > > > > > > However using the same patch *solely* on the (copied) src/timezone/dirmod.c > does > > *not* fix the issue - I wonder if the linker picking up dirmod.o from > src/port > > instead of src/timezone? > > > > regards > > > > Mark > > > > Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > > > > > > > OK, I have just applied a patch to src/timezone/Makefile which will fix > > > this by compiling dirmod.c specially like we do in other Makefiles. > > > > > > Patch attached. > > > > > > > --------------------------------------------------------------------------- > > > > > > markir@coretech.co.nz wrote: > > > > I get a build failure (win 2000 pro): > > > > > > > > gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes > > > -Wmissing-declarations > > > > zic.o ialloc.o scheck.o localtime.o -L../../src/port -lpgport > -lwsock32 > > > -lm > > > > -lws2_32 -o zic.exe > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0xc6):dirmod.c: undefined > > > reference > > > > to `pgwin32_backend_usleep' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0xe4):dirmod.c: undefined > > > reference > > > > to `errstart' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0xf2):dirmod.c: undefined > > > reference > > > > to `elog_finish' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x11d):dirmod.c: undefined > > > reference > > > > to `errstart' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x12b):dirmod.c: undefined > > > reference > > > > to `elog_finish' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1c3):dirmod.c: undefined > > > reference > > > > to `pgwin32_backend_usleep' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1e1):dirmod.c: undefined > > > reference > > > > to `errstart' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1f1):dirmod.c: undefined > > > reference > > > > to `elog_finish' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x21c):dirmod.c: undefined > > > reference > > > > to `errstart' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x22c):dirmod.c: undefined > > > reference > > > > to `elog_finish' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x459):dirmod.c: undefined > > > reference > > > > to `errstart' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4aa):dirmod.c: undefined > > > reference > > > > to `errmsg' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4b4):dirmod.c: undefined > > > reference > > > > to `errcode_for_file_access' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4bc):dirmod.c: undefined > > > reference > > > > to `errfinish' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x51a):dirmod.c: undefined > > > reference > > > > to `pfree' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x5ea):dirmod.c: undefined > > > reference > > > > to `_imp__CurrentMemoryContext' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x5f2):dirmod.c: undefined > > > reference > > > > to `MemoryContextAlloc' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x64d):dirmod.c: undefined > > > reference > > > > to `_imp__CurrentMemoryContext' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x656):dirmod.c: undefined > > > reference > > > > to `MemoryContextStrdup' > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x50a):dirmod.c: undefined > > > reference > > > > to `pfree' > > > > make[2]: *** [zic] Error 1 > > > > make[2]: Leaving directory > > > > `/home/Administrator/develop/c/postgresql-8.0devel/src/timezone' > > > > make[1]: *** [all] Error 2 > > > > make[1]: Leaving directory > > > > `/home/Administrator/develop/c/postgresql-8.0devel/src' > > > > make: *** [all] Error 2 > > > > > > > > > > > > Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > > > > > > > > > OK, got them all. Thanks. Patch attached. > > > > > > > > > > Would someone retest on Win32? > > > > > > > > > > > > > > --------------------------------------------------------------------------- > > > > > > > > > > Andreas Pflug wrote: > > > > > > Bruce Momjian wrote: > > > > > > > OK, applied. I moved the funciton into port/dirmod.c and cleaned > up > > > the > > > > > > > interface for Win32. > > > > > > > > > > > > > > Would someone test this on Win32 in case I broke something? > > > > > > > > > > > > Yes, something's broken, see patch. > > > > > > > > > > > > Second, HAVE_SYMLINK must be defined somewhere (configure?). > > > > > > > > > > > > Third, a junction is a directory, not a file, so DROP tablespace > must > > > > > > use rmdir, not unlink to remove the junction; see my original > patch. > > > > > > > > > > > > Regards, > > > > > > Andreas > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------(end of > > > broadcast)--------------------------- > > > > > > TIP 2: you can get off all lists at once with the unregister > command > > > > > > (send "unregister YourEmailAddressHere" to > > > majordomo@postgresql.org) > > > > > > > > > > -- > > > > > Bruce Momjian | http://candle.pha.pa.us > > > > > pgman@candle.pha.pa.us | (610) 359-1001 > > > > > + If your life is a hard drive, | 13 Roberts Road > > > > > + Christ can be your backup. | Newtown Square, > Pennsylvania > > > 19073 > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Bruce Momjian | http://candle.pha.pa.us > > > pgman@candle.pha.pa.us | (610) 359-1001 > > > + If your life is a hard drive, | 13 Roberts Road > > > + Christ can be your backup. | Newtown Square, Pennsylvania > 19073 > > > > > > > > > > > > > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 359-1001 > + If your life is a hard drive, | 13 Roberts Road > + Christ can be your backup. | Newtown Square, Pennsylvania 19073 > > ---------------------------(end of broadcast)--------------------------- > TIP 3: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >
Nope, you need Makefile 1.15. Must be a lag. --------------------------------------------------------------------------- markir@coretech.co.nz wrote: > Hmmm...updated and tried to rebuild - I get the same error! > > It looks like I have the latest src/timezone/Makefile (1.14) > > The only thing I am doing that is a bit different perhaps is : > > - on Freebsd performing cvs update -d -P > - followed by ./configure;make dist > - copy the archive to win2000 and build (msys 1.0.10, mingw 3.0.1-1) > > regards > > Mark > > (I guess the next best thing for me to try is a *completely* fresh checkout...) > > Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > > > > I just committed the final fix for zic and Claudio has compiled it so > > please grab cvs head and give it a try. > > > > --------------------------------------------------------------------------- > > > > markir@coretech.co.nz wrote: > > > Unfortunately I am still seeing the same error - I can "fix" it by with > > this: > > > > > > *** dirmod.c.orig Sun Aug 8 17:14:48 2004 > > > --- dirmod.c Sun Aug 8 17:14:59 2004 > > > *************** > > > *** 15,20 **** > > > --- 15,21 ---- > > > > > *------------------------------------------------------------------------- > > > */ > > > > > > + #define FRONTEND > > > #ifndef FRONTEND > > > #include "postgres.h" > > > #else > > > > > > > > > However using the same patch *solely* on the (copied) src/timezone/dirmod.c > > does > > > *not* fix the issue - I wonder if the linker picking up dirmod.o from > > src/port > > > instead of src/timezone? > > > > > > regards > > > > > > Mark > > > > > > Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > > > > > > > > > > OK, I have just applied a patch to src/timezone/Makefile which will fix > > > > this by compiling dirmod.c specially like we do in other Makefiles. > > > > > > > > Patch attached. > > > > > > > > > > --------------------------------------------------------------------------- > > > > > > > > markir@coretech.co.nz wrote: > > > > > I get a build failure (win 2000 pro): > > > > > > > > > > gcc -O2 -fno-strict-aliasing -Wall -Wmissing-prototypes > > > > -Wmissing-declarations > > > > > zic.o ialloc.o scheck.o localtime.o -L../../src/port -lpgport > > -lwsock32 > > > > -lm > > > > > -lws2_32 -o zic.exe > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0xc6):dirmod.c: undefined > > > > reference > > > > > to `pgwin32_backend_usleep' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0xe4):dirmod.c: undefined > > > > reference > > > > > to `errstart' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0xf2):dirmod.c: undefined > > > > reference > > > > > to `elog_finish' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x11d):dirmod.c: undefined > > > > reference > > > > > to `errstart' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x12b):dirmod.c: undefined > > > > reference > > > > > to `elog_finish' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1c3):dirmod.c: undefined > > > > reference > > > > > to `pgwin32_backend_usleep' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1e1):dirmod.c: undefined > > > > reference > > > > > to `errstart' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x1f1):dirmod.c: undefined > > > > reference > > > > > to `elog_finish' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x21c):dirmod.c: undefined > > > > reference > > > > > to `errstart' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x22c):dirmod.c: undefined > > > > reference > > > > > to `elog_finish' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x459):dirmod.c: undefined > > > > reference > > > > > to `errstart' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4aa):dirmod.c: undefined > > > > reference > > > > > to `errmsg' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4b4):dirmod.c: undefined > > > > reference > > > > > to `errcode_for_file_access' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x4bc):dirmod.c: undefined > > > > reference > > > > > to `errfinish' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x51a):dirmod.c: undefined > > > > reference > > > > > to `pfree' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x5ea):dirmod.c: undefined > > > > reference > > > > > to `_imp__CurrentMemoryContext' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x5f2):dirmod.c: undefined > > > > reference > > > > > to `MemoryContextAlloc' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x64d):dirmod.c: undefined > > > > reference > > > > > to `_imp__CurrentMemoryContext' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x656):dirmod.c: undefined > > > > reference > > > > > to `MemoryContextStrdup' > > > > > ../../src/port/libpgport.a(dirmod.o)(.text+0x50a):dirmod.c: undefined > > > > reference > > > > > to `pfree' > > > > > make[2]: *** [zic] Error 1 > > > > > make[2]: Leaving directory > > > > > `/home/Administrator/develop/c/postgresql-8.0devel/src/timezone' > > > > > make[1]: *** [all] Error 2 > > > > > make[1]: Leaving directory > > > > > `/home/Administrator/develop/c/postgresql-8.0devel/src' > > > > > make: *** [all] Error 2 > > > > > > > > > > > > > > > Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > > > > > > > > > > > OK, got them all. Thanks. Patch attached. > > > > > > > > > > > > Would someone retest on Win32? > > > > > > > > > > > > > > > > > > --------------------------------------------------------------------------- > > > > > > > > > > > > Andreas Pflug wrote: > > > > > > > Bruce Momjian wrote: > > > > > > > > OK, applied. I moved the funciton into port/dirmod.c and cleaned > > up > > > > the > > > > > > > > interface for Win32. > > > > > > > > > > > > > > > > Would someone test this on Win32 in case I broke something? > > > > > > > > > > > > > > Yes, something's broken, see patch. > > > > > > > > > > > > > > Second, HAVE_SYMLINK must be defined somewhere (configure?). > > > > > > > > > > > > > > Third, a junction is a directory, not a file, so DROP tablespace > > must > > > > > > > use rmdir, not unlink to remove the junction; see my original > > patch. > > > > > > > > > > > > > > Regards, > > > > > > > Andreas > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ---------------------------(end of > > > > broadcast)--------------------------- > > > > > > > TIP 2: you can get off all lists at once with the unregister > > command > > > > > > > (send "unregister YourEmailAddressHere" to > > > > majordomo@postgresql.org) > > > > > > > > > > > > -- > > > > > > Bruce Momjian | http://candle.pha.pa.us > > > > > > pgman@candle.pha.pa.us | (610) 359-1001 > > > > > > + If your life is a hard drive, | 13 Roberts Road > > > > > > + Christ can be your backup. | Newtown Square, > > Pennsylvania > > > > 19073 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Bruce Momjian | http://candle.pha.pa.us > > > > pgman@candle.pha.pa.us | (610) 359-1001 > > > > + If your life is a hard drive, | 13 Roberts Road > > > > + Christ can be your backup. | Newtown Square, Pennsylvania > > 19073 > > > > > > > > > > > > > > > > > > > > -- > > Bruce Momjian | http://candle.pha.pa.us > > pgman@candle.pha.pa.us | (610) 359-1001 > > + If your life is a hard drive, | 13 Roberts Road > > + Christ can be your backup. | Newtown Square, Pennsylvania 19073 > > > > ---------------------------(end of broadcast)--------------------------- > > TIP 3: if posting/reading through Usenet, please send an appropriate > > subscribe-nomail command to majordomo@postgresql.org so that your > > message can get through to the mailing list cleanly > > > > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if your > joining column's datatypes do not match > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
It was, next update got it! Of course I found the src/utils issue then.... However, with the patch for that applied I can confirm a successful build! (create/drop tablespace works too) regards Mark Quoting Bruce Momjian <pgman@candle.pha.pa.us>: > > Nope, you need Makefile 1.15. Must be a lag. > >
markir@coretech.co.nz wrote: > > (create/drop tablespace works too) I can *not* confirm this; after configure; make clean; make; make install I got "tablespace not supported". pg_config.h lacks HAVE_SYMLINK=1. Regards, Andreas
Interesting, After repeating 'make distclean;./configure --without-zlib' I have a pg_config.h *with* HAVE_SYMLINK=1. (To cover all the bases, adding in zlib support still results in HAVE_SYMLINK=1 for me) At this point, sleeping seems quite attractive... regards Mark Quoting Andreas Pflug <pgadmin@pse-consulting.de>: > markir@coretech.co.nz wrote: > > > > (create/drop tablespace works too) > > I can *not* confirm this; after configure; make clean; make; make > install I got "tablespace not supported". pg_config.h lacks HAVE_SYMLINK=1. > > Regards, > Andreas > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend >
markir@coretech.co.nz wrote: > Interesting, > > After repeating 'make distclean;./configure --without-zlib' I have a > pg_config.h *with* HAVE_SYMLINK=1. Right, symlinks are supported in Win32 now. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
markir@coretech.co.nz wrote: > It was, next update got it! Of course I found the src/utils issue then.... > > However, with the patch for that applied I can confirm a successful build! What patch is that? -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
Andreas Pflug wrote: > markir@coretech.co.nz wrote: > > > > (create/drop tablespace works too) > > I can *not* confirm this; after configure; make clean; make; make > install I got "tablespace not supported". pg_config.h lacks HAVE_SYMLINK=1. I am confused. We have something in configure that forces HAVE_SYMLINK=1 if you are win32. Would you try a 'gmake distclean'? I think that might fix it. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
markir@coretech.co.nz wrote: > Interesting, > > After repeating 'make distclean;./configure --without-zlib' I have a > pg_config.h *with* HAVE_SYMLINK=1. > Sorry, mea culpa. I did a simple clean, not a distclean. Works ok. Regards, Andreas
Andreas Pflug wrote: > markir@coretech.co.nz wrote: > > Interesting, > > > > After repeating 'make distclean;./configure --without-zlib' I have a > > pg_config.h *with* HAVE_SYMLINK=1. > > > > Sorry, mea culpa. I did a simple clean, not a distclean. Works ok. Perfect! I didn't think distclean would be required but I guess it was. -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073
Sorry Bruce - I meant your 'fix for win32 pgport and pg_dumpall' patch. Mark Bruce Momjian wrote: >markir@coretech.co.nz wrote: > > >>It was, next update got it! Of course I found the src/utils issue then.... >> >>However, with the patch for that applied I can confirm a successful build! >> >> > >What patch is that? > > >