From 170105c86762751e685ab6837e7bf049e955660e Mon Sep 17 00:00:00 2001 From: Julien Rouhaud Date: Sat, 20 Jul 2024 07:23:24 +0800 Subject: [PATCH] Fix powa_stat_archiver_src for pg 10- And also run ci for pg 9.6 to test this code path. Surprisingly the ci fails for pg9.6 for any attemp immeditely after a successful pg_ctl start, so I'm adding a 1 second sleep, which seems to be reliable enough. --- .github/workflows/tests.yml | 3 +++ powa--5.0.0dev.sql | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e964989..4e8c7da 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -20,6 +20,7 @@ jobs: strategy: matrix: postgres_major_version: [ + "9.6", "10", "11", "12", @@ -79,6 +80,8 @@ jobs: pg_ctl -D $DATADIR initdb echo "shared_preload_libraries = 'pg_stat_statements'" >> $DATADIR/postgresql.conf pg_ctl -D $DATADIR -l $LOGFILE start || cat $LOGFILE + # a sleep is required for pg9.6 (at least) + sleep 1 psql -c 'select 1 as ok' postgres - name: Build and install powa-archivist for postgres ${{ matrix.postgres_major_version }} diff --git a/powa--5.0.0dev.sql b/powa--5.0.0dev.sql index 6ba0b05..b33b51d 100644 --- a/powa--5.0.0dev.sql +++ b/powa--5.0.0dev.sql @@ -4448,7 +4448,7 @@ BEGIN v_current_wal := NULL; ELSE IF current_setting('server_version_num')::int < 100000 THEN - v_current_wal := pg_walfile_name(pg_last_wal_receive_lsn()); + v_current_wal := pg_xlogfile_name(pg_current_xlog_location()); ELSE v_current_wal := pg_walfile_name(pg_current_wal_lsn()); END IF;