This is an automated email from the ASF dual-hosted git repository.
yjhjstz pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git
The following commit(s) were added to refs/heads/main by this push:
new 5804930146 Fix gpcheckcat that checks foreign key reference for
appendonly tables
5804930146 is described below
commit 580493014687545e3d50d779461e96289bf4c510
Author: Hao Wu <[email protected]>
AuthorDate: Tue Mar 11 08:08:12 2025 +0000
Fix gpcheckcat that checks foreign key reference for appendonly tables
As https://github.com/greenplum-db/gpdb-archive/commit/afde39b3f973c
committed in Greenplum upstream, the partition table allows to have
table access method.
One additional behavior is that the normal appendonly tables have
their entries in pg_appendonly, one-per-entry. But the partition
table hasn't. The foreign key check is applied. Missing entry in
pg_appendonly for tables with relam to be ao_row/ao_column will
be reported in gpcheckcat.
This commit backports partial changes from the above commit,
and will fix the catalog issue.
---
gpMgmt/bin/gpcheckcat_modules/foreign_key_check.py | 2 +-
gpMgmt/bin/gppylib/test/unit/test_unit_foreign_key_check.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gpMgmt/bin/gpcheckcat_modules/foreign_key_check.py
b/gpMgmt/bin/gpcheckcat_modules/foreign_key_check.py
index 549f88da2d..ad4c1543fa 100644
--- a/gpMgmt/bin/gpcheckcat_modules/foreign_key_check.py
+++ b/gpMgmt/bin/gpcheckcat_modules/foreign_key_check.py
@@ -15,7 +15,7 @@ class ForeignKeyCheck:
self.shared_option = shared_option
self.autoCast = autoCast
self.query_filters = dict()
- self.query_filters['pg_appendonly.relid'] = "(select amname from pg_am
am where am.oid = relam) IN ('ao_row', 'ao_column')"
+ self.query_filters['pg_appendonly.relid'] = "((select amname from
pg_am am where am.oid = relam) IN ('ao_row', 'ao_column')) AND relkind != 'p'"
self.query_filters['pg_attribute.attrelid'] = "(relnatts > 0 or
relnatts is NULL)"
self.query_filters["pg_index.indexrelid"] = "(relkind='i')"
diff --git a/gpMgmt/bin/gppylib/test/unit/test_unit_foreign_key_check.py
b/gpMgmt/bin/gppylib/test/unit/test_unit_foreign_key_check.py
index 99e6af0ef7..9888472bb4 100755
--- a/gpMgmt/bin/gppylib/test/unit/test_unit_foreign_key_check.py
+++ b/gpMgmt/bin/gppylib/test/unit/test_unit_foreign_key_check.py
@@ -175,7 +175,7 @@ class GpCheckCatTestCase(GpTestCase):
####################### PRIVATE METHODS #######################
def _get_filter(self, table_name):
query_filters = {}
- query_filters['pg_appendonly'] = "(select amname from pg_am am where
am.oid = relam) IN ('ao_row', 'ao_column')"
+ query_filters['pg_appendonly'] = "((select amname from pg_am am where
am.oid = relam) IN ('ao_row', 'ao_column')) AND relkind != 'p'"
query_filters['pg_attribute'] = "(relnatts > 0 or relnatts is NULL)"
query_filters['pg_constraint'] = "((relchecks>0 or relhaspkey='t') and
relkind = 'r')"
query_filters['gp_distribution_policy'] = """(relnamespace not
in(select oid from pg_namespace where nspname ~ 'pg_')
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]