Skip to content

Commit

Permalink
function amcheck: add heapallindexed
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks authored Aug 1, 2022
1 parent 9a7e2cb commit 9bc5745
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pgbackrest_auto
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ function amcheck(){
indexes=$(psql -p "${PGPORT}" -d "$db_name" -tXAc "SELECT quote_ident(n.nspname)||'.'||quote_ident(c.relname) FROM pg_index i JOIN pg_opclass op ON i.indclass[0] = op.oid JOIN pg_am am ON op.opcmethod = am.oid JOIN pg_class c ON i.indexrelid = c.oid JOIN pg_namespace n ON c.relnamespace = n.oid WHERE am.amname = 'btree' AND n.nspname NOT IN ('pg_catalog', 'pg_toast') AND c.relpersistence != 't' AND c.relkind = 'i' AND i.indisready AND i.indisvalid")
for index in $indexes; do
# info "amcheck: verify the logical consistency of the structure of index ${index}"
if ! psql -v ON_ERROR_STOP=on -p "${PGPORT}" -d "$db_name" -tAXc "SELECT bt_index_parent_check('${index}')" 1> /dev/null
if ! psql -v ON_ERROR_STOP=on -p "${PGPORT}" -d "$db_name" -tAXc "select bt_index_parent_check('${index}', heapallindexed => true)" 1> /dev/null
then
warnmsg "amcheck: logical validation for index ${index} ( database $db_name ) - Failed"
sed -i 's/Amcheck_validation=1/Amcheck_validation=0/g' "${status_file}"
Expand Down

0 comments on commit 9bc5745

Please sign in to comment.