1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-24 08:52:38 +02:00

[PBCKP-120] skip partitioned indexes for checkdb --amcheck

Tags: pg_probackup
This commit is contained in:
Sofia Kopikova 2022-06-20 13:44:42 +03:00
parent 4728756e21
commit 0b8cf419c3
2 changed files with 16 additions and 3 deletions

View File

@ -461,7 +461,9 @@ get_index_list(const char *dbname, bool first_db_with_amcheck,
"LEFT JOIN pg_catalog.pg_class cls ON idx.indexrelid=cls.oid "
"LEFT JOIN pg_catalog.pg_namespace nmspc ON cls.relnamespace=nmspc.oid "
"LEFT JOIN pg_catalog.pg_am am ON cls.relam=am.oid "
"WHERE am.amname='btree' AND cls.relpersistence != 't' "
"WHERE am.amname='btree' "
"AND cls.relpersistence != 't' "
"AND cls.relkind != 'I' "
"ORDER BY nmspc.nspname DESC",
0, NULL);
}
@ -473,8 +475,10 @@ get_index_list(const char *dbname, bool first_db_with_amcheck,
"LEFT JOIN pg_catalog.pg_class cls ON idx.indexrelid=cls.oid "
"LEFT JOIN pg_catalog.pg_namespace nmspc ON cls.relnamespace=nmspc.oid "
"LEFT JOIN pg_catalog.pg_am am ON cls.relam=am.oid "
"WHERE am.amname='btree' AND cls.relpersistence != 't' AND "
"(cls.reltablespace IN "
"WHERE am.amname='btree' "
"AND cls.relpersistence != 't' "
"AND cls.relkind != 'I' "
"AND (cls.reltablespace IN "
"(SELECT oid from pg_catalog.pg_tablespace where spcname <> 'pg_global') "
"OR cls.reltablespace = 0) "
"ORDER BY nmspc.nspname DESC",

View File

@ -38,6 +38,15 @@ class CheckdbTest(ProbackupTest, unittest.TestCase):
node.safe_psql(
"postgres",
"create index on t_heap(id)")
node.safe_psql(
"postgres",
"create table idxpart (a int) "
"partition by range (a)")
node.safe_psql(
"postgres",
"create index on idxpart(a)")
try:
node.safe_psql(