/rtmp/pg_upgrade.diff
text/x-diff
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| contrib/pg_upgrade/info.c | 0 | 0 |
commit 9e5bed2df1693a46dfaed862d7462ba2379f8f79
Author: Bruce Momjian <bruce@momjian.us>
Date: Sat Mar 5 21:12:21 2011 -0500
Restructure pg_upgrade checks because pre-8.4 Postgres did not rename
toast file names to match the new relfilenode.
diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c
index a502507..ad7edc4 100644
*** a/contrib/pg_upgrade/info.c
--- b/contrib/pg_upgrade/info.c
*************** gen_db_file_maps(DbInfo *old_db, DbInfo
*** 51,59 ****
RelInfo *new_rel = &new_db->rel_arr.rels[relnum];
if (old_rel->reloid != new_rel->reloid)
! pg_log(PG_FATAL, "mismatch of relation id: database \"%s\", old relid %d, new relid %d\n",
old_db->db_name, old_rel->reloid, new_rel->reloid);
!
create_rel_filename_map(old_pgdata, new_pgdata, old_db, new_db,
old_rel, new_rel, maps + num_maps);
num_maps++;
--- 51,68 ----
RelInfo *new_rel = &new_db->rel_arr.rels[relnum];
if (old_rel->reloid != new_rel->reloid)
! pg_log(PG_FATAL, "Mismatch of relation id: database \"%s\", old relid %d, new relid %d\n",
old_db->db_name, old_rel->reloid, new_rel->reloid);
!
! /* toast names were not renamed to match their relfilenodes in pre-8.4 */
! if (GET_MAJOR_VERSION(old_cluster.major_version) >= 804 &&
! (strcmp(old_rel->nspname, new_rel->nspname) != 0 ||
! strcmp(old_rel->relname, new_rel->relname) != 0))
! pg_log(PG_FATAL, "Mismatch of relation names: database \"%s\", "
! "old rel %s.%s, new rel %s.%s\n",
! old_db->db_name, old_rel->nspname, old_rel->relname,
! new_rel->nspname, new_rel->relname);
!
create_rel_filename_map(old_pgdata, new_pgdata, old_db, new_db,
old_rel, new_rel, maps + num_maps);
num_maps++;
*************** create_rel_filename_map(const char *old_
*** 104,115 ****
/* new_relfilenode will match old and new pg_class.oid */
map->new_relfilenode = new_rel->relfilenode;
- if (strcmp(old_rel->nspname, new_rel->nspname) != 0 ||
- strcmp(old_rel->relname, new_rel->relname) != 0)
- pg_log(PG_FATAL, "mismatch of relation id: database \"%s\", old rel %s.%s, new rel %s.%s\n",
- old_db->db_name, old_rel->nspname, old_rel->relname,
- new_rel->nspname, new_rel->relname);
-
/* used only for logging and error reporing, old/new are identical */
snprintf(map->nspname, sizeof(map->nspname), "%s", old_rel->nspname);
snprintf(map->relname, sizeof(map->relname), "%s", old_rel->relname);
--- 113,118 ----