PostgreSQL Bugs

Collected from the PG bugs email list.

Bug ID16285
PG Version12.2
OSUbuntu 18.04.3 LTS
Opened2020-03-02 22:39:14+00
Reported byVictor Yegorov
StatusNew

Body of first available message related to this bug follows.

The following bug has been logged on the website:

Bug reference:      16285
Logged by:          Victor Yegorov
Email address:      (redacted)
PostgreSQL version: 12.2
Operating system:   Ubuntu 18.04.3 LTS
Description:        

I have an index, that is giving issues pageinspect-ing it:

SELECT * FROM bt_metap('index')\gx
ERROR:  value "2180413846" is out of range for type integer

At the same time:

SELECT * FROM pgstatindex('index')\gx
-[ RECORD 1 ]------+----------
version            | 3
tree_level         | 2
index_size         | 131571712
root_block_no      | 290
internal_pages     | 56
leaf_pages         | 16003
empty_pages        | 0
deleted_pages      | 1
avg_leaf_density   | 50.06
leaf_fragmentation | 66.08

Looking at the sources of both extensions, I can see, that pgstatindex() is
using psprintf(INT64_FORMAT) for page counters and psprintf("%u") for root
page, while bt_metap() is using only psprintf("%d");

I assume psprintf("%u") should be used at least for metad->btm_root and
metad->btm_fastroot in the bt_metap(PG_FUNCTION_ARGS) function.

Messages

DateAuthorSubject
2020-03-02 22:39:14+00PG Bug reporting formBUG #16285: bt_metap fails with value is out of range for type integer
2020-03-02 23:03:25+00Peter GeogheganRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-02 23:19:13+00Victor YegorovRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-03 01:39:36+00Alvaro HerreraRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-06 01:46:02+00Peter GeogheganRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-06 09:38:20+00Victor YegorovRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-06 22:23:40+00Peter GeogheganRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-08 00:45:27+00Peter GeogheganRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-08 07:47:20+00Victor YegorovRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-09 22:09:30+00Andres FreundRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-09 22:31:38+00Peter GeogheganRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-09 22:35:57+00Andres FreundRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-10 00:16:47+00Peter GeogheganRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-10 00:22:33+00Andres FreundRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-10 00:27:53+00Peter GeogheganRe: BUG #16285: bt_metap fails with value is out of range for type integer
2020-03-11 21:16:26+00Peter GeogheganRe: BUG #16285: bt_metap fails with value is out of range for type integer