aboutsummaryrefslogtreecommitdiff
path: root/contrib/pageinspect/gistfuncs.c
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2021-02-14 20:11:11 -0800
committerPeter Geoghegan <pg@bowt.ie>2021-02-14 20:11:11 -0800
commit9e596b65f430fcb942685b41860b323398a88873 (patch)
tree70b294d13b358b72e0802137d8fb6909ff7b2f05 /contrib/pageinspect/gistfuncs.c
parentfa41cf8f183ac5d702e91da567e9b3375c632081 (diff)
downloadpostgresql-9e596b65f430fcb942685b41860b323398a88873.tar.gz
postgresql-9e596b65f430fcb942685b41860b323398a88873.zip
Add "LP_DEAD item?" column to GiST pageinspect functions
This brings gist_page_items() and gist_page_items_bytea() in line with nbtree's bt_page_items() function. Minor follow-up to commit 756ab291, which added the GiST functions. Author: Andrey Borodin <x4mmm@yandex-team.ru> Discussion: https://postgr.es/m/E0794687-7315-4C29-A9C7-EC54D448596D@yandex-team.ru
Diffstat (limited to 'contrib/pageinspect/gistfuncs.c')
-rw-r--r--contrib/pageinspect/gistfuncs.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/pageinspect/gistfuncs.c b/contrib/pageinspect/gistfuncs.c
index 66a7f5562f2..eb9f6303df6 100644
--- a/contrib/pageinspect/gistfuncs.c
+++ b/contrib/pageinspect/gistfuncs.c
@@ -146,8 +146,8 @@ gist_page_items_bytea(PG_FUNCTION_ARGS)
offset <= maxoff;
offset++)
{
- Datum values[4];
- bool nulls[4];
+ Datum values[5];
+ bool nulls[5];
ItemId id;
IndexTuple itup;
bytea *tuple_bytea;
@@ -170,7 +170,8 @@ gist_page_items_bytea(PG_FUNCTION_ARGS)
tuple_bytea = (bytea *) palloc(tuple_len + VARHDRSZ);
SET_VARSIZE(tuple_bytea, tuple_len + VARHDRSZ);
memcpy(VARDATA(tuple_bytea), itup, tuple_len);
- values[3] = PointerGetDatum(tuple_bytea);
+ values[3] = BoolGetDatum(ItemIdIsDead(id));
+ values[4] = PointerGetDatum(tuple_bytea);
tuplestore_putvalues(tupstore, tupdesc, values, nulls);
}
@@ -237,8 +238,8 @@ gist_page_items(PG_FUNCTION_ARGS)
offset <= maxoff;
offset++)
{
- Datum values[4];
- bool nulls[4];
+ Datum values[5];
+ bool nulls[5];
ItemId id;
IndexTuple itup;
Datum itup_values[INDEX_MAX_KEYS];
@@ -260,14 +261,15 @@ gist_page_items(PG_FUNCTION_ARGS)
values[0] = DatumGetInt16(offset);
values[1] = ItemPointerGetDatum(&itup->t_tid);
values[2] = Int32GetDatum((int) IndexTupleSize(itup));
+ values[3] = BoolGetDatum(ItemIdIsDead(id));
key_desc = BuildIndexValueDescription(indexRel, itup_values, itup_isnull);
if (key_desc)
- values[3] = CStringGetTextDatum(key_desc);
+ values[4] = CStringGetTextDatum(key_desc);
else
{
- values[3] = (Datum) 0;
- nulls[3] = true;
+ values[4] = (Datum) 0;
+ nulls[4] = true;
}
tuplestore_putvalues(tupstore, tupdesc, values, nulls);