提交 754c47e0 编写于 作者: A Alexandra Wang 提交者: Lei (Alexandra) Wang

Update AO visimap char from 'm' to 'M' in pg_upgrade

Relkind 'm' stands for materialized view now. This addressed a
GPDB_93_MERGE_FIXME.
Co-authored-by: NAlexandra Wang <lewang@pivotal.io>
Co-authored-by: NJimmy Yih <jyih@pivotal.io>
上级 6e3cd6c6
......@@ -532,7 +532,7 @@ get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo)
" ON c.relnamespace = n.oid "
"LEFT OUTER JOIN pg_catalog.pg_index i "
" ON c.oid = i.indexrelid "
"WHERE relkind IN ('r', 'o', 'm', 'b', 'i'%s) AND "
"WHERE relkind IN ('r', 'o', 'b', 'i'%s%s) AND "
/*
* pg_dump only dumps valid indexes; testing indisready is necessary in
......@@ -551,6 +551,9 @@ get_rel_infos(ClusterInfo *cluster, DbInfo *dbinfo)
" c.oid >= %u) "
" OR (n.nspname = 'pg_catalog' AND "
" relname IN ('pg_largeobject', 'pg_largeobject_loid_pn_index'%s) ));",
/* Greenplum 4.3/5X use 'm' as aovisimap which is now matview in 6X and above. */
(GET_MAJOR_VERSION(old_cluster.major_version) <= 803) ?
", 'm'" : ", 'M'",
/* see the comment at the top of old_8_3_create_sequence_script() */
(GET_MAJOR_VERSION(old_cluster.major_version) <= 803) ?
"" : ", 'S'",
......
......@@ -995,10 +995,14 @@ set_frozenxids(bool minmxid_only)
*
* The logic here should keep consistent with function
* should_have_valid_relfrozenxid().
*
* Notes: if we ever backport this to Greenplum 5X, remove 'm' first
* and then replace 'M' with 'm', because 'm' used to be RELKIND
* visimap in 4.3/5X, not matview
*/
"WHERE (relkind IN ('r', 'm', 't') "
"AND NOT relfrozenxid = 0) "
"OR (relkind IN ('t', 'o', 'b', 'm'))",
"OR (relkind IN ('t', 'o', 'b', 'M'))",
old_cluster.controldata.chkpnt_nxtxid));
/* set pg_class.relminmxid */
......
......@@ -172,10 +172,6 @@ DESCR("");
#define RELKIND_AOSEGMENTS 'o' /* AO segment files and eof's */
#define RELKIND_AOBLOCKDIR 'b' /* AO block directory */
#define RELKIND_AOVISIMAP 'M' /* AO visibility map */
// GPDB_93_MERGE_FIXME: RELKIND_AOVISIMAP used to be 'm', but that means MATVIEW now.
// Find all the places where it might be referred to using just 'm', without using this
// macro. E.g. pg_dump and psql. They might need to also work differently depending
// on version.
#define RELPERSISTENCE_PERMANENT 'p' /* regular table */
#define RELPERSISTENCE_UNLOGGED 'u' /* unlogged permanent table */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册