mirror of https://github.com/postgres/postgres
The regression tests of pg_walinspect are reworked on a few aspects: - Reorganization on the validation checks done for the start and end LSNs on the six SQL functions currently available in 1.1. - Addition of a few patterns doing bound checks for invalid start LSN, invalid end LSN, and failures in reading LSN positions, for anything that's been missing. - Use of a consistent style across the whole, limiting blank lines across the queries. - Addition of a new test script for upgrades. For the time being, this is straight-forward with a check that the upgrade from 1.0 works correctly. This will be made more complicated once the interface of this extension is reworked in 1.1 with a follow-up patch. Most of the contents of this commit are extracted from a larger patch by the same author, largely reorganized by me to minimize the differences with the upcoming work aimed to lift the bound checks on the input LSNs used by the functions of this extension. Author: Bharath Rupireddy, Michael Paquier Discussion: https://postgr.es/m/CALj2ACU0_q-o4DSweyaW9NO1KBx-QkN6G_OzYQvpjf3CZVASkg@mail.gmail.compull/136/head
parent
767c598954
commit
1f282c24e4
@ -0,0 +1,30 @@ |
||||
-- test old extension version entry points |
||||
CREATE EXTENSION pg_walinspect WITH VERSION '1.0'; |
||||
-- List what version 1.0 contains |
||||
\dx+ pg_walinspect |
||||
Objects in extension "pg_walinspect" |
||||
Object description |
||||
----------------------------------------------------------- |
||||
function pg_get_wal_record_info(pg_lsn) |
||||
function pg_get_wal_records_info(pg_lsn,pg_lsn) |
||||
function pg_get_wal_records_info_till_end_of_wal(pg_lsn) |
||||
function pg_get_wal_stats(pg_lsn,pg_lsn,boolean) |
||||
function pg_get_wal_stats_till_end_of_wal(pg_lsn,boolean) |
||||
(5 rows) |
||||
|
||||
-- Move to new version 1.1 |
||||
ALTER EXTENSION pg_walinspect UPDATE TO '1.1'; |
||||
-- List what version 1.1 contains |
||||
\dx+ pg_walinspect |
||||
Objects in extension "pg_walinspect" |
||||
Object description |
||||
----------------------------------------------------------- |
||||
function pg_get_wal_block_info(pg_lsn,pg_lsn) |
||||
function pg_get_wal_record_info(pg_lsn) |
||||
function pg_get_wal_records_info(pg_lsn,pg_lsn) |
||||
function pg_get_wal_records_info_till_end_of_wal(pg_lsn) |
||||
function pg_get_wal_stats(pg_lsn,pg_lsn,boolean) |
||||
function pg_get_wal_stats_till_end_of_wal(pg_lsn,boolean) |
||||
(6 rows) |
||||
|
||||
DROP EXTENSION pg_walinspect; |
@ -0,0 +1,14 @@ |
||||
-- test old extension version entry points |
||||
|
||||
CREATE EXTENSION pg_walinspect WITH VERSION '1.0'; |
||||
|
||||
-- List what version 1.0 contains |
||||
\dx+ pg_walinspect |
||||
|
||||
-- Move to new version 1.1 |
||||
ALTER EXTENSION pg_walinspect UPDATE TO '1.1'; |
||||
|
||||
-- List what version 1.1 contains |
||||
\dx+ pg_walinspect |
||||
|
||||
DROP EXTENSION pg_walinspect; |
Loading…
Reference in new issue