Re: pageinspect: Hash index support
Jesper Pedersen <jesper.pedersen@redhat.com>
From: Jesper Pedersen <jesper.pedersen@redhat.com>
To: Michael Paquier <michael.paquier@gmail.com>
Cc: Ashutosh Sharma <ashu.coek88@gmail.com>,
Jeff Janes
<jeff.janes@gmail.com>,
Alvaro Herrera <alvherre@2ndquadrant.com>,
PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2016-09-21T13:30:44Z
Lists: pgsql-hackers
Attachments
- 0001-pageinspect-Hash-index-support_v5.patch (text/x-patch)
On 09/21/2016 08:43 AM, Michael Paquier wrote: >> page_stats / page_items should not be used on the metadata page. >> >> As these functions are marked as superuser only it is expected that people >> provides the correct input, especially since the raw page structure is used >> as the input. > > btree functions use the block number to do some sanity checks. You > cannot do that here as only bytea functions are available, but you > could do it in verify_hash_page by looking at the opaque data and look > at LH_META_PAGE. Then add a boolean argument into verify_hash_page to > see if the caller expects a meta page or not and just issue an error. > Actually it would be a good idea to put in those safeguards, even if I > agree with you that calling those functions is at the risk of the > user... Could you update the patch in this sense? > > I had fun doing the same tests, aka running the items and stats > functions on a meta page, and the meta function on a non-meta page, > but at my surprise I did not see a crash, so perhaps I was lucky and > perhaps that was because of OSX. > Attached is v5, which add basic page verification. Thanks for the feedback ! Best regards, Jesper
Commits
-
Fix incorrect typecast.
- b4316928d57b 10.0 landed
-
In pageinspect/hashfuncs.c, avoid crashes on alignment-picky machines.
- 14e9b18fed28 10.0 landed
-
pageinspect: Support hash indexes.
- 08bf6e529587 10.0 landed
-
Add uuid to the set of types supported by contrib/btree_gist.
- 11da83a0e70d 10.0 cited
-
Allow CREATE EXTENSION to follow extension update paths.
- 40b449ae84dc 10.0 cited