Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e643a31

Browse files
committed
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
1 parent c9a272d commit e643a31

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

contrib/pg_walinspect/expected/oldextversions.out

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

contrib/pg_walinspect/sql/oldextversions.sql

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ CREATE EXTENSION pg_walinspect WITH VERSION '1.0';
55
-- Mask DETAIL messages as these could refer to current LSN positions.
66
\set VERBOSITY terse
77

8-
-- List what version 1.0 contains
9-
\dx+ pg_walinspect
8+
-- List what version 1.0 contains, using a locale-independent sorting.
9+
SELECT pg_describe_object(classid, objid, 0) AS obj
10+
FROM pg_depend
11+
WHERE refclassid = 'pg_extension'::regclass AND
12+
refobjid = (SELECT oid FROM pg_extension
13+
WHERE extname = 'pg_walinspect') AND deptype = 'e'
14+
ORDER BY pg_describe_object(classid, objid, 0) COLLATE "C";
1015

1116
-- Make sure checkpoints don't interfere with the test.
1217
SELECT 'init' FROM pg_create_physical_replication_slot('regress_pg_walinspect_slot', true, false);

0 commit comments

Comments
 (0)