pgsql: Fix handling of non-upgraded B-tree metapages

From: Teodor Sigaev <teodor(at)sigaev(dot)ru>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix handling of non-upgraded B-tree metapages
Date: 2018-04-05 14:56:18
Message-ID: E1f46JG-0007n3-BP@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix handling of non-upgraded B-tree metapages

857f9c36 bumps B-tree metapage version while upgrade is performed "on the fly"
when needed. However, some asserts fired when old version metapage was
cached to rel->rd_amcache. Despite new metadata fields are never used from
rel->rd_amcache, that needs to be fixed. This patch introduces metadata
upgrade during its caching, which fills unavailable fields with their default
values. contrib/pageinspect is also patched to handle non-upgraded metapages
in the same way.

Author: Alexander Korotkov

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0a64b45152b593c5eb95f2e88fbce7fbfe84ae7b

Modified Files
--------------
contrib/pageinspect/btreefuncs.c | 17 ++++++++++++--
src/backend/access/nbtree/nbtpage.c | 47 ++++++++++++++++++++++++++++++++-----
2 files changed, 56 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Teodor Sigaev 2018-04-05 15:19:35 pgsql: Add support of bool, bpchar, name and uuid to btree_gin
Previous Message Pavan Deolasee 2018-04-05 13:27:40 Re: pgsql: Optimize btree insertions for common case of increasing values