From 6eb9c5a5657d1fe77b55cc261450f3538d35a94d Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Sat, 4 May 2024 14:19:15 +0200
Subject: Adding upstream version 13.4.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
---
 contrib/pageinspect/sql/brin.sql | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 contrib/pageinspect/sql/brin.sql

(limited to 'contrib/pageinspect/sql/brin.sql')

diff --git a/contrib/pageinspect/sql/brin.sql b/contrib/pageinspect/sql/brin.sql
new file mode 100644
index 0000000..735bc3b
--- /dev/null
+++ b/contrib/pageinspect/sql/brin.sql
@@ -0,0 +1,18 @@
+CREATE TABLE test1 (a int, b text);
+INSERT INTO test1 VALUES (1, 'one');
+CREATE INDEX test1_a_idx ON test1 USING brin (a);
+
+SELECT brin_page_type(get_raw_page('test1_a_idx', 0));
+SELECT brin_page_type(get_raw_page('test1_a_idx', 1));
+SELECT brin_page_type(get_raw_page('test1_a_idx', 2));
+
+SELECT * FROM brin_metapage_info(get_raw_page('test1_a_idx', 0));
+SELECT * FROM brin_metapage_info(get_raw_page('test1_a_idx', 1));
+
+SELECT * FROM brin_revmap_data(get_raw_page('test1_a_idx', 0)) LIMIT 5;
+SELECT * FROM brin_revmap_data(get_raw_page('test1_a_idx', 1)) LIMIT 5;
+
+SELECT * FROM brin_page_items(get_raw_page('test1_a_idx', 2), 'test1_a_idx')
+    ORDER BY blknum, attnum LIMIT 5;
+
+DROP TABLE test1;
-- 
cgit v1.2.3

