Re: BUG #6733: All Tables Empty After pg_upgrade (PG 9.2.0 beta 2) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #6733: All Tables Empty After pg_upgrade (PG 9.2.0 beta 2)
Date
Msg-id 15721.1342585913@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #6733: All Tables Empty After pg_upgrade (PG 9.2.0 beta 2)  (Bruce Momjian <bruce@momjian.us>)
Responses Re: BUG #6733: All Tables Empty After pg_upgrade (PG 9.2.0 beta 2)  (Mike Wilson <mfwilson@gmail.com>)
List pgsql-bugs
Bruce Momjian <bruce@momjian.us> writes:
> I am using git head for testing.  Tom sees a few things odd in
> load_directory() that might be causing some problems on Solaris, and
> this is new code for 9.2 for Solaris, so that might explain it.  I think
> we need Tom to finish and then if you can grab our git source and test
> that, it would be great!

The only thing I see that looks likely to represent a platform-specific
issue is the entrysize calculation.  Mike, just out of curiosity, could
you see if the attached patch makes things better for you?

            regards, tom lane

diff --git a/contrib/pg_upgrade/file.c b/contrib/pg_upgrade/file.c
index 1dd3722142c9e83c1ec228099c3a3fd302a2179b..c886a67df43792a1692eec6b3b90238413e9f844 100644
*** a/contrib/pg_upgrade/file.c
--- b/contrib/pg_upgrade/file.c
*************** load_directory(const char *dirname, stru
*** 259,265 ****
              return -1;
          }

!         entrysize = sizeof(struct dirent) - sizeof(direntry->d_name) +
              strlen(direntry->d_name) + 1;

          (*namelist)[name_num] = (struct dirent *) malloc(entrysize);
--- 259,265 ----
              return -1;
          }

!         entrysize = offsetof(struct dirent, d_name) +
              strlen(direntry->d_name) + 1;

          (*namelist)[name_num] = (struct dirent *) malloc(entrysize);

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #6733: All Tables Empty After pg_upgrade (PG 9.2.0 beta 2)
Next
From: exclusion@gmail.com
Date:
Subject: BUG #6742: pg_dump doesn't convert encoding of DB object names to OS encoding