diff options
| author | Michael Paquier <michael@paquier.xyz> | 2023-03-23 11:50:35 +0900 |
|---|---|---|
| committer | Michael Paquier <michael@paquier.xyz> | 2023-03-23 11:50:35 +0900 |
| commit | 4f1882b960596c35d62c78fb44e14913eff49a85 (patch) | |
| tree | 477cf449882682763d7920a7227f16f67c5d07f5 /contrib/pg_walinspect/sql/oldextversions.sql | |
| parent | 8fba928fd78856712f69d96852f8061e77390fda (diff) | |
Improve a bit the tests of pg_walinspect
This commit improves the tests of pg_walinspect on a few things:
- Remove aggregates for queries that should fail. If the code is
reworked in such a way that the behavior of these queries is changed,
we would get more input from them, written this way.
- Expect at least one record reported in the valid queries doing scans
across ranges, rather than zero records.
- Adjust a few comments, for consistency.
Author: Bharath Rupireddy
Discussion: https://postgr.es/m/CALj2ACVaoXW3nJD9zq8E66BEf-phgJfFcKRVJq9GXkuX0b3ULQ@mail.gmail.com
Diffstat (limited to 'contrib/pg_walinspect/sql/oldextversions.sql')
| -rw-r--r-- | contrib/pg_walinspect/sql/oldextversions.sql | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/pg_walinspect/sql/oldextversions.sql b/contrib/pg_walinspect/sql/oldextversions.sql index 1f8307816ef..e35c4f3ed15 100644 --- a/contrib/pg_walinspect/sql/oldextversions.sql +++ b/contrib/pg_walinspect/sql/oldextversions.sql @@ -1,4 +1,4 @@ --- test old extension version entry points +-- Test old extension version entry points. CREATE EXTENSION pg_walinspect WITH VERSION '1.0'; @@ -20,16 +20,17 @@ CREATE TABLE sample_tbl(col1 int, col2 int); SELECT pg_current_wal_lsn() AS wal_lsn1 \gset INSERT INTO sample_tbl SELECT * FROM generate_series(1, 2); --- Check bounds for these past functions. +-- Tests for the past functions. SELECT COUNT(*) >= 1 AS ok FROM pg_get_wal_records_info_till_end_of_wal(:'wal_lsn1'); SELECT COUNT(*) >= 1 AS ok FROM pg_get_wal_stats_till_end_of_wal(:'wal_lsn1'); -SELECT COUNT(*) >= 1 AS ok FROM pg_get_wal_records_info_till_end_of_wal('FFFFFFFF/FFFFFFFF'); -SELECT COUNT(*) >= 1 AS ok FROM pg_get_wal_stats_till_end_of_wal('FFFFFFFF/FFFFFFFF'); +-- Failures with start LSNs. +SELECT * FROM pg_get_wal_records_info_till_end_of_wal('FFFFFFFF/FFFFFFFF'); +SELECT * FROM pg_get_wal_stats_till_end_of_wal('FFFFFFFF/FFFFFFFF'); --- Move to new version 1.1 +-- Move to new version 1.1. ALTER EXTENSION pg_walinspect UPDATE TO '1.1'; --- List what version 1.1 contains +-- List what version 1.1 contains. \dx+ pg_walinspect SELECT pg_drop_replication_slot('regress_pg_walinspect_slot'); |
