Re: BUG #16285: bt_metap fails with value is out of range for type integer

Victor Yegorov <vyegorov@gmail.com>

From: Victor Yegorov <vyegorov@gmail.com>
To: Peter Geoghegan <pg@bowt.ie>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2020-03-02T23:19:13Z
Lists: pgsql-bugs
вт, 3 мар. 2020 г. в 01:03, Peter Geoghegan <pg@bowt.ie>:

> I think it's more likely that the problem here is the relatively new
> column returned by bt_metap(), oldest_xact. That has only been around
> since Postgres v11.
>

This made me look at the stats, as this is a test copy of the DB upgraded
to 12.2 recently. Per pg_stat_user_tables,
table had never been vacuumed since upgrade, only analyzed.
I've run vacuum manually and this made the issue go away.

It is beyond my skills to try to find the real place for this issue now. I
think we might be hitting some uninitialized value somewhere, perhaps?..

-- 
Victor Yegorov

Commits

  1. Paper over bt_metap() oldest_xact bug in backbranches.

  2. pageinspect: Fix types used for bt_metap() columns.

  3. Skip full index scan during cleanup of B-tree indexes when possible

  4. pg_stat_statements: Widen query IDs from 32 bits to 64 bits.