From e643a315fc58deae20877e2e69358c95087fa09a Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Thu, 16 Mar 2023 13:24:12 +0900 Subject: [PATCH] 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 --- contrib/pg_walinspect/expected/oldextversions.out | 12 ++++++++---- contrib/pg_walinspect/sql/oldextversions.sql | 9 +++++++-- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/contrib/pg_walinspect/expected/oldextversions.out b/contrib/pg_walinspect/expected/oldextversions.out index 7949555c847..da18914d922 100644 --- a/contrib/pg_walinspect/expected/oldextversions.out +++ b/contrib/pg_walinspect/expected/oldextversions.out @@ -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) diff --git a/contrib/pg_walinspect/sql/oldextversions.sql b/contrib/pg_walinspect/sql/oldextversions.sql index 258a0098883..1f8307816ef 100644 --- a/contrib/pg_walinspect/sql/oldextversions.sql +++ b/contrib/pg_walinspect/sql/oldextversions.sql @@ -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);