1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-22 23:02:54 +03:00

Tweak regression test of pg_walinspect to be less collation-sensitive

\dx was used on pg_walinspect to list its objects in 1.0 but the names
of the objects in this version do not have an order that is always
guaranteed depending on the collation used.  Rather than append a
COLLATE clause in the query of \dx, this tweaks the regression test to
produce an output whose order is guaranteed.

Reported-by: Andres Freund
Author: Bharath Rupireddy
Discussion: https://postgr.es/m/20230314215440.gma7g4keswdnldj5@awork3.anarazel.de
This commit is contained in:
Michael Paquier 2023-03-16 13:24:12 +09:00
parent c9a272daaa
commit e643a315fc
2 changed files with 15 additions and 6 deletions

View File

@ -2,10 +2,14 @@
CREATE EXTENSION pg_walinspect WITH VERSION '1.0';
-- Mask DETAIL messages as these could refer to current LSN positions.
\set VERBOSITY terse
-- List what version 1.0 contains
\dx+ pg_walinspect
Objects in extension "pg_walinspect"
Object description
-- List what version 1.0 contains, using a locale-independent sorting.
SELECT pg_describe_object(classid, objid, 0) AS obj
FROM pg_depend
WHERE refclassid = 'pg_extension'::regclass AND
refobjid = (SELECT oid FROM pg_extension
WHERE extname = 'pg_walinspect') AND deptype = 'e'
ORDER BY pg_describe_object(classid, objid, 0) COLLATE "C";
obj
-----------------------------------------------------------
function pg_get_wal_record_info(pg_lsn)
function pg_get_wal_records_info(pg_lsn,pg_lsn)

View File

@ -5,8 +5,13 @@ CREATE EXTENSION pg_walinspect WITH VERSION '1.0';
-- Mask DETAIL messages as these could refer to current LSN positions.
\set VERBOSITY terse
-- List what version 1.0 contains
\dx+ pg_walinspect
-- List what version 1.0 contains, using a locale-independent sorting.
SELECT pg_describe_object(classid, objid, 0) AS obj
FROM pg_depend
WHERE refclassid = 'pg_extension'::regclass AND
refobjid = (SELECT oid FROM pg_extension
WHERE extname = 'pg_walinspect') AND deptype = 'e'
ORDER BY pg_describe_object(classid, objid, 0) COLLATE "C";
-- Make sure checkpoints don't interfere with the test.
SELECT 'init' FROM pg_create_physical_replication_slot('regress_pg_walinspect_slot', true, false);