Skip to content

Commit

Permalink
PMM-9875 Add version check.
Browse files Browse the repository at this point in the history
  • Loading branch information
JiriCtvrtka committed Sep 21, 2022
1 parent 3ad90e1 commit ff8d677
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions agent/agents/postgres/pgstatmonitor/pgstatmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,16 @@ func (m *PGStatMonitorQAN) getNewBuckets(ctx context.Context, periodLengthSecs u
}

func (m *PGStatMonitorQAN) checkErrorsView(ctx context.Context) error {
vPGSM, _, err := getPGMonitorVersion(m.q)
if err != nil {
return errors.Wrap(err, "failed to get row and view for pg_stat_monitor version")
}

// Errors view is supported in PGSM 2.0 and higher.
if vPGSM < pgStatMonitorVersion20PG12 {
return nil
}

row := &pgStatMonitorErrors{}
rows, err := m.q.SelectRows(pgStatMonitorErrorsView, "")
if err != nil {
Expand Down

0 comments on commit ff8d677

Please sign in to comment.