diff options
| author | Robert Haas | 2016-03-11 17:28:22 +0000 |
|---|---|---|
| committer | Robert Haas | 2016-03-11 17:34:20 +0000 |
| commit | 7087166a88fe0c04fc6636d0d6d6bea1737fc1fb (patch) | |
| tree | 94b7681005b94722dab2dab8b3630532e1e78cd3 /src/bin/pg_upgrade/pg_upgrade.h | |
| parent | 9118d03a8cca3d97327c56bf89a72e328e454e63 (diff) | |
pg_upgrade: Convert old visibility map format to new format.
Commit a892234f830e832110f63fc0a2afce2fb21d1584 added a second bit per
page to the visibility map, but pg_upgrade has been unaware of it up
until now. Therefore, a pg_upgrade from an earlier major release of
PostgreSQL to any commit preceding this one and following the one
mentioned above would result in invalid visibility map contents on the
new cluster, very possibly leading to data corruption. This plugs
that hole.
Masahiko Sawada, reviewed by Jeff Janes, Bruce Momjian, Simon Riggs,
Michael Paquier, Andres Freund, me, and others.
Diffstat (limited to 'src/bin/pg_upgrade/pg_upgrade.h')
| -rw-r--r-- | src/bin/pg_upgrade/pg_upgrade.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/pg_upgrade/pg_upgrade.h b/src/bin/pg_upgrade/pg_upgrade.h index 61228780d43..89beb739556 100644 --- a/src/bin/pg_upgrade/pg_upgrade.h +++ b/src/bin/pg_upgrade/pg_upgrade.h @@ -110,6 +110,10 @@ extern char *output_files[]; #define VISIBILITY_MAP_CRASHSAFE_CAT_VER 201107031 /* + * The format of visibility map is changed with this 9.6 commit, + */ +#define VISIBILITY_MAP_FROZEN_BIT_CAT_VER 201603011 +/* * pg_multixact format changed in 9.3 commit 0ac5ad5134f2769ccbaefec73844f85, * ("Improve concurrency of foreign key locking") which also updated catalog * version to this value. pg_upgrade behavior depends on whether old and new @@ -365,6 +369,8 @@ bool pid_lock_file_exists(const char *datadir); const char *copyFile(const char *src, const char *dst, bool force); const char *linkFile(const char *src, const char *dst); +const char *rewriteVisibilityMap(const char *fromfile, const char *tofile, + bool force); void check_hard_link(void); FILE *fopen_priv(const char *path, const char *mode); |
