summaryrefslogtreecommitdiff
path: root/contrib/pageinspect/sql/oldextversions.sql
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2021-07-12 11:05:27 +0900
committerMichael Paquier <michael@paquier.xyz>2021-07-12 11:05:27 +0900
commit127404fbe28455d6e8183fa58f3b7aefeba8f909 (patch)
tree3381e6ab834dc7cb4eba384fff52d3aa061aba95 /contrib/pageinspect/sql/oldextversions.sql
parent626731db26ae2617e41536678440c3817128a006 (diff)
downloadpostgresql-127404fbe28455d6e8183fa58f3b7aefeba8f909.tar.gz
pageinspect: Improve page_header() for pages of 32kB
ld_upper, ld_lower, pd_special and the page size have been using smallint as return type, which could cause those fields to return negative values in certain cases for builds configures with a page size of 32kB. Bump pageinspect to 1.10. page_header() is able to handle the correct return type of those fields at runtime when using an older version of the extension, with some tests are added to cover that. Author: Quan Zongliang Reviewed-by: Michael Paquier, Bharath Rupireddy Discussion: https://postgr.es/m/8b8ec36e-61fe-14f9-005d-07bc85aa4eed@yeah.net
Diffstat (limited to 'contrib/pageinspect/sql/oldextversions.sql')
-rw-r--r--contrib/pageinspect/sql/oldextversions.sql6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/pageinspect/sql/oldextversions.sql b/contrib/pageinspect/sql/oldextversions.sql
index 78e08f40e8..9f953492c2 100644
--- a/contrib/pageinspect/sql/oldextversions.sql
+++ b/contrib/pageinspect/sql/oldextversions.sql
@@ -16,5 +16,11 @@ SELECT page_checksum(get_raw_page('test1', 0), 0) IS NOT NULL AS silly_checksum_
SELECT * FROM bt_page_stats('test1_a_idx', 1);
SELECT * FROM bt_page_items('test1_a_idx', 1);
+-- page_header() uses int instead of smallint for lower, upper, special and
+-- pagesize in pageinspect >= 1.10.
+ALTER EXTENSION pageinspect UPDATE TO '1.9';
+\df page_header
+SELECT pagesize, version FROM page_header(get_raw_page('test1', 0));
+
DROP TABLE test1;
DROP EXTENSION pageinspect;