pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: vyegorov@gmail.com
Subject: BUG #16285: bt_metap fails with value is out of range for type integer
Date: Mon, 02 Mar 2020 22:39:14 +0000
Message-ID: <16285-df8fc1000ab3d5fc@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16285
Logged by:          Victor Yegorov
Email address:      vyegorov@gmail.com
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.



view thread (16+ messages)  latest in thread

Message-ID: <16285-df8fc1000ab3d5fc@postgresql.org>
Permalink:  ../16285-df8fc1000ab3d5fc@postgresql.org/
Also on:    postgresql.org/message-id/16285-df8fc1000ab3d5fc@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, vyegorov@gmail.com
  Subject: Re: BUG #16285: bt_metap fails with value is out of range for type integer
  In-Reply-To: <16285-df8fc1000ab3d5fc@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox