Skip to content

Commit

Permalink
Ignore manual vacuums if we can't access pg_stat_progress_vacuum
Browse files Browse the repository at this point in the history
Before this was failing with an error because we couldn't determine
the relation and namespace name correctly. Without access to the
pg_stat_progress_vacuum table this is not possible to do reliably, so
skip manual vacuums instead in that situation.

Fixes #113
  • Loading branch information
lfittl committed Dec 6, 2020
1 parent 6e41676 commit f93f235
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion input/postgres/vacuum_progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ SELECT (query_start_epoch || padded_pid)::bigint AS vacuum_identity,
JOIN activity a USING (pid)
LEFT JOIN pg_catalog.pg_class c ON (c.oid = v.relid)
LEFT JOIN pg_catalog.pg_namespace n ON (n.oid = c.relnamespace)
WHERE v.relid IS NOT NULL OR a.query <> '<insufficient privilege>'
WHERE v.relid IS NOT NULL OR (a.query <> '<insufficient privilege>' AND a.nspname IS NOT NULL AND a.relname IS NOT NULL)
`

func GetVacuumProgress(logger *util.Logger, db *sql.DB, postgresVersion state.PostgresVersion, ignoreRegexp string) ([]state.PostgresVacuumProgress, error) {
Expand Down

0 comments on commit f93f235

Please sign in to comment.