Skip to content

Commit

Permalink
Ignore partition table in check_last_maintenance
Browse files Browse the repository at this point in the history
Partitioned tables are empty, thus last_* are null.

Fix OPMDG#365
  • Loading branch information
anayrat committed May 15, 2024
1 parent c086240 commit ff54e0c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion check_pgactivity
Original file line number Diff line number Diff line change
Expand Up @@ -5053,9 +5053,11 @@ sub check_last_maintenance {
FROM pg_catalog.pg_stat_database
WHERE datname = current_database()
)
FROM pg_stat_user_tables
FROM pg_stat_user_tables a
JOIN pg_class b on a.relid = b.oid
WHERE schemaname NOT LIKE 'pg_temp_%'
AND schemaname NOT LIKE 'pg_toast_temp_%'
AND relkind <> 'p' -- partitioned table do not have last_* information
}
);

Expand Down

0 comments on commit ff54e0c

Please sign in to comment.