From c0c85cec4919564fad389fc2916c44a0de02dc78 Mon Sep 17 00:00:00 2001
From: Corey Huinker <corey.huinker@gmail.com>
Date: Tue, 27 Jan 2026 01:40:14 -0500
Subject: [PATCH v32 1/4] Add output test for pg_dependencies statistics
 import.

Commit 302879bd68d115 tests the ability to set pg_dependencies values,
but does not actually verify that the value was set.

This test is the pg_dependencies equivalent of a test on pg_ndistinct
found in 0e80f3f88deaef.
---
 src/test/regress/expected/stats_import.out | 11 +++++++++++
 src/test/regress/sql/stats_import.sql      |  6 ++++++
 2 files changed, 17 insertions(+)

diff --git a/src/test/regress/expected/stats_import.out b/src/test/regress/expected/stats_import.out
index b5664e5513c..5b584d05cea 100644
--- a/src/test/regress/expected/stats_import.out
+++ b/src/test/regress/expected/stats_import.out
@@ -1824,6 +1824,17 @@ WHERE e.statistics_schemaname = 'stats_import' AND
  [{"attributes": [2, 3], "ndistinct": 4}]
 (1 row)
 
+SELECT replace(e.dependencies, '}, ', E'},\n') AS dependencies
+FROM pg_stats_ext AS e
+WHERE e.statistics_schemaname = 'stats_import'
+AND e.statistics_name = 'test_stat_dependencies'
+AND e.inherited = false;
+                        dependencies                        
+------------------------------------------------------------
+ [{"attributes": [2], "dependency": 3, "degree": 1.000000},+
+ {"attributes": [3], "dependency": 2, "degree": 1.000000}]
+(1 row)
+
 DROP SCHEMA stats_import CASCADE;
 NOTICE:  drop cascades to 7 other objects
 DETAIL:  drop cascades to type stats_import.complex_type
diff --git a/src/test/regress/sql/stats_import.sql b/src/test/regress/sql/stats_import.sql
index 3e70b817513..41fed995977 100644
--- a/src/test/regress/sql/stats_import.sql
+++ b/src/test/regress/sql/stats_import.sql
@@ -1303,4 +1303,10 @@ WHERE e.statistics_schemaname = 'stats_import' AND
     e.statistics_name = 'test_stat_ndistinct' AND
     e.inherited = false;
 
+SELECT replace(e.dependencies, '}, ', E'},\n') AS dependencies
+FROM pg_stats_ext AS e
+WHERE e.statistics_schemaname = 'stats_import'
+AND e.statistics_name = 'test_stat_dependencies'
+AND e.inherited = false;
+
 DROP SCHEMA stats_import CASCADE;

base-commit: 851f6649cc18c4b482fa2b6afddb65b35d035370
-- 
2.52.0

