Skip to content

Commit

Permalink
Compatibility with pg14 (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberDem0n committed May 25, 2021
1 parent fcc3a7b commit 504af68
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ jobs:
- '11'
- '12'
- '13'
- '14'

steps:
- uses: actions/checkout@v1
- name: Set up packages
run: |
set -e
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
sudo sh -c "echo \"deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main $PG\" > /etc/apt/sources.list.d/pgdg.list"
sudo apt-get update
sudo apt-get install -yq --no-install-suggests --no-install-recommends curl postgresql-common lcov libevent-dev pv brotli libbrotli1 libbrotli-dev
# forbid creation of a main cluster when package is installed
Expand All @@ -50,7 +51,7 @@ jobs:
- name: Run tests
run: |
PATH=/usr/lib/postgresql/$PG/bin:$PATH bash -x test.sh
if grep -E '(ERROR|FATAL)' test_cluster?/pg_log/postgresql.log | grep -Ev '(no COPY in progress|could not connect to|could not send|database system is shutting|error reading result of streaming command|database system is starting up|log:noisia)'; then exit 1; fi
if grep -E '(ERROR|FATAL)' test_cluster?/pg_log/postgresql.log | grep -Ev '(no COPY in progress|could not connect to|could not send|the database system is not yet accepting connections|database system is shutting|error reading result of streaming command|database system is starting up|log:noisia)'; then exit 1; fi
- name: Generate lcov.info
run: |
Expand Down
5 changes: 5 additions & 0 deletions postgres_stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "storage/ipc.h"
#include "storage/predicate_internals.h"
#include "storage/procarray.h"
#include "storage/proc.h"

#include "system_stats.h"
#include "postgres_stats.h"
Expand Down Expand Up @@ -1277,7 +1278,11 @@ pg_stat get_postgres_stats(void)
#endif
pg_stats_new.wal_metrics.last_wal_replay_lsn = GetXLogReplayRecPtr(NULL);
pg_stats_new.wal_metrics.last_xact_replay_timestamp = GetLatestXTime();
#if PG_VERSION_NUM >= 140000
pg_stats_new.wal_metrics.is_wal_replay_paused = GetRecoveryPauseState() != RECOVERY_NOT_PAUSED;
#else
pg_stats_new.wal_metrics.is_wal_replay_paused = RecoveryIsPaused();
#endif


merge_stats(&pg_stats_new.activity, proc_stats);
Expand Down

0 comments on commit 504af68

Please sign in to comment.