pageinspect: add tuple_data_record()

Поиск
Список
Период
Сортировка
От James Coleman
Тема pageinspect: add tuple_data_record()
Дата
Msg-id CAAaqYe_WVpVBf=j9g3Vg1_y+y9Ff0jfSKpNrAxwcsB1L9Twybg@mail.gmail.com
обсуждение исходный текст
Ответы Re: pageinspect: add tuple_data_record()
Re: pageinspect: add tuple_data_record()
Список pgsql-hackers
Background:
In my usage of pageinspect for debugging or other purposes I often find it frustrating that I don't have a way to easily view a heap page's tuple data as actual records rather than binary data. After encountering this again last week while doing some data recovery after an accidental delete (and manually parsing a few int and timestamp fields with get_byte magic) I decided to write up a patch to add a function to handle this case.

Summary:
The new function tuple_data_record() parallels the existing tuple_data_split() function, but instead of returning a bytea array of raw attribute heap values, it returns a row type of the relation being examined.

Status:
The attached patch applies to master and builds cleanly and passes tests locally. It is still WIP (see TODOs below), but is (I believe) functionally complete.

This is my first patch submission, so I encountered a few questions that the coding style docs didn't seem to address, like whether it's preferable to line up variable declarations by name.

After my refactor of tuple_data_split_internal() I'm considering inlining that function (and the similar tuple_data_record_internal() function) into tuple_data_{split,record}(). I'd appreciate feedback on this possibility.

TODO:
- Add documentation.
- Consider inlining _internal functions.

Thanks,
James Coleman
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: TupleTableSlot abstraction
Следующее
От: Andres Freund
Дата:
Сообщение: Re: pageinspect: add tuple_data_record()