[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    [HACKERS] Fix for pg_update on win32
From:       Bruce Momjian <bruce () momjian ! us>
Date:       2011-07-30 5:56:39
Message-ID: 201107300556.p6U5udi22629 () momjian ! us
[Download RAW message or body]

Based on EnterpriseDB testing, I have applied the attached patch to fix
a pg_upgrade bug on Win32 on 9.1 and 9.2.  The problem is that on Win32
you can't stat() a directory with a trailing slash --- this is already
mentioned in our src/port/path.c.  The patch removes a lone trailing
slash.

-- 
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +

["/rtmp/diff" (/rtmp/diff)]

diff --git a/contrib/pg_upgrade/exec.c b/contrib/pg_upgrade/exec.c
new file mode 100644
index ef21899..b632584
*** a/contrib/pg_upgrade/exec.c
--- b/contrib/pg_upgrade/exec.c
*************** check_data_dir(const char *pg_data)
*** 168,174 ****
  	{
  		struct stat statBuf;
  
! 		snprintf(subDirName, sizeof(subDirName), "%s/%s", pg_data,
  				 requiredSubdirs[subdirnum]);
  
  		if (stat(subDirName, &statBuf) != 0)
--- 168,176 ----
  	{
  		struct stat statBuf;
  
! 		snprintf(subDirName, sizeof(subDirName), "%s%s%s", pg_data,
! 			/* Win32 can't stat() a directory with a trailing slash. */
! 				 *requiredSubdirs[subdirnum] ? "/" : "",
  				 requiredSubdirs[subdirnum]);
  
  		if (stat(subDirName, &statBuf) != 0)


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic