2. +CREATE FUNCTION gin_metapage(IN page bytea, + OUT pending_head bigint, + OUT pending_tail bigint, + OUT version int4) +AS 'MODULE_PATHNAME', 'gin_metapage' +LANGUAGE C STRICT; a. Isn't it better to name the function as gin_metap(..) similar to existing function bt_metap(..)?
I actually liked more gin_metapage_info, a name similar to the newly-introduced brin indexes.
b. Can this function have a similar signature as bt_metap() which means it should take input as relname?
That's mostly a matter of taste but I think we should definitely pass a raw page to it as it is now. This has the advantage to add an extra check if the page passed is really a meta page of not, something useful for development.
3. Can gin_dataleafpage() API have similar name and signature as API bt_page_items() exposed for btree?
What about gin_leafpage_items then?
The signature of bt_page_items() isn't a good example to follow. It existed before the get_raw_page() function, and the other functions that are designed to work with that, was added. gin_leafpage_items() name seems fine to me.
When I call gin_leafpage_items on a {leaf} page, I get the ERROR:
ERROR: input page is not a compressed GIN data leaf page
DETAIL: Flags 0002, expected 0083
I'm don't know why it won't work on an uncompressed leaf page (or for that matter, why my index pages are not compressed), but the docs should probably note the restriction.