From 715bcb405a32037e2c006ce0822aa3ed5c0570da Mon Sep 17 00:00:00 2001
From: Zsolt Parragi <zsolt.parragi@percona.com>
Date: Tue, 18 Feb 2025 22:58:49 +0000
Subject: [PATCH] Earthdistance test should only list objects from the public
 schema

It is possible to run the test suite with additional extensions
installed to make sure that everything works with them. If the
additional extension is installed in a custom schema it doesn't change
any of the normal test outputs.

Except for the eartdistance test, which lists all objects from every
schema.

This commit modifies the testcase so that it only selects objects from
the public schema to avoid this. This was already the case for part of
the test, these changes that unify everything in it.
---
 contrib/earthdistance/expected/earthdistance.out | 10 +++++-----
 contrib/earthdistance/sql/earthdistance.sql      | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/contrib/earthdistance/expected/earthdistance.out b/contrib/earthdistance/expected/earthdistance.out
index 26a843c3faa..298df2152a3 100644
--- a/contrib/earthdistance/expected/earthdistance.out
+++ b/contrib/earthdistance/expected/earthdistance.out
@@ -962,7 +962,7 @@ SELECT abs(cube_distance(ll_to_earth(-30,-90), '(0)'::cube) / earth() - 1) <
 -- Now we are going to test extension create/drop scenarios.
 --
 -- list what's installed
-\dT
+\dT public.*
                                               List of data types
  Schema | Name  |                                         Description                                         
 --------+-------+---------------------------------------------------------------------------------------------
@@ -979,7 +979,7 @@ drop type cube;  -- fail, extension cube requires it
 ERROR:  cannot drop type cube because extension cube requires it
 HINT:  You can drop extension cube instead.
 -- list what's installed
-\dT
+\dT public.*
                                              List of data types
  Schema | Name |                                         Description                                         
 --------+------+---------------------------------------------------------------------------------------------
@@ -994,19 +994,19 @@ HINT:  Use DROP ... CASCADE to drop the dependent objects too.
 drop table foo;
 drop extension cube;
 -- list what's installed
-\dT
+\dT public.*
      List of data types
  Schema | Name | Description 
 --------+------+-------------
 (0 rows)
 
-\df
+\df public.*
                        List of functions
  Schema | Name | Result data type | Argument data types | Type 
 --------+------+------------------+---------------------+------
 (0 rows)
 
-\do
+\do public.*
                              List of operators
  Schema | Name | Left arg type | Right arg type | Result type | Description 
 --------+------+---------------+----------------+-------------+-------------
diff --git a/contrib/earthdistance/sql/earthdistance.sql b/contrib/earthdistance/sql/earthdistance.sql
index 41455612175..e80a7c53e30 100644
--- a/contrib/earthdistance/sql/earthdistance.sql
+++ b/contrib/earthdistance/sql/earthdistance.sql
@@ -304,7 +304,7 @@ SELECT abs(cube_distance(ll_to_earth(-30,-90), '(0)'::cube) / earth() - 1) <
 --
 
 -- list what's installed
-\dT
+\dT public.*
 
 drop extension cube;  -- fail, earthdistance requires it
 
@@ -313,7 +313,7 @@ drop extension earthdistance;
 drop type cube;  -- fail, extension cube requires it
 
 -- list what's installed
-\dT
+\dT public.*
 
 create table foo (f1 cube, f2 int);
 
@@ -324,9 +324,9 @@ drop table foo;
 drop extension cube;
 
 -- list what's installed
-\dT
-\df
-\do
+\dT public.*
+\df public.*
+\do public.*
 
 create schema c;
 
-- 
2.43.0

