user-friendliness improvement of pageinspect

Started by Yang Jiealmost 8 years ago6 messageshackers
Jump to latest
#1Yang Jie
yonj1e@163.com

Hi,

Why does the heap_page_item () of the pageinspect extension not consider providing better user-friendliness?

My test table has the following data, and when I look at the t_data I see data of type bytea instead of a more intuitive type, even the same type as the original table.

# select * from test1;
a | b
---+------
1 | text
(1 row)

# SELECT lp as tuple, t_xmin, t_xmax, t_attrs[1] as a, t_attrs[2] as b FROM heap_page_item_attrs(get_raw_page('test1', 0), 'test1');
tuple | t_xmin | t_xmax | a | b
-------+--------+--------+------------+--------------
1 | 587 | 0 | \x01000000 | \x0b74657874
(1 row)

Similar to this effect:

# SELECT lp as tuple, t_xmin, t_xmax, t_attrs[1] as a, t_attrs[2] as b FROM heap_page_item_attrs(get_raw_page('test1', 0), 'test1');
tuple | t_xmin | t_xmax | a | b
-------+--------+--------+------------+--------------
1 | 587 | 0 | 1 | text
(1 row)

Look forward to the solution.

In reply to: Yang Jie (#1)
Re: user-friendliness improvement of pageinspect

On Tue, Jul 10, 2018 at 12:41 AM, 杨杰 <yonj1e@163.com> wrote:

Why does the heap_page_item () of the pageinspect extension not consider
providing better user-friendliness?

My test table has the following data, and when I look at the t_data I see
data of type bytea instead of a more intuitive type, even the same type as
the original table.

tuple_data_split() can do this (split the data into individual
attributes). If you want a friendlier, more visual way of getting this
information, then you may find pg_hexedit helpful:

https://github.com/petergeoghegan/pg_hexedit

--
Peter Geoghegan

#3Yang Jie
yonj1e@163.com
In reply to: Peter Geoghegan (#2)
回复: user-friendliness improvement of pageinspect

Thank you for your answer.

my question is not split the data into individual attributes.
I want to see the data in the table, but I don't want to be a bytea type.

在2018年7月11日 02:48,Peter Geoghegan<pg@bowt.ie> 写道:
On Tue, Jul 10, 2018 at 12:41 AM, 杨杰 <yonj1e@163.com> wrote:
Why does the heap_page_item () of the pageinspect extension not consider
providing better user-friendliness?

My test table has the following data, and when I look at the t_data I see
data of type bytea instead of a more intuitive type, even the same type as
the original table.

tuple_data_split() can do this (split the data into individual
attributes). If you want a friendlier, more visual way of getting this
information, then you may find pg_hexedit helpful:

https://github.com/petergeoghegan/pg_hexedit

--
Peter Geoghegan

In reply to: Yang Jie (#3)
Re: user-friendliness improvement of pageinspect

On Tue, Jul 10, 2018 at 6:44 PM, Yang Jie <yonj1e@163.com> wrote:

my question is not split the data into individual attributes.
I want to see the data in the table, but I don't want to be a bytea type.

What's wrong with simply using an SQL query?

--
Peter Geoghegan

#5Yang Jie
yonj1e@163.com
In reply to: Peter Geoghegan (#4)
Re: user-friendliness improvement of pageinspect

Simple queries are fine, but pageinspect can query previous data. If you return the same result as a simple query, this is similar to the oracle flashback version query.

On 7/11/2018 09:51,Peter Geoghegan<pg@bowt.ie> wrote:
On Tue, Jul 10, 2018 at 6:44 PM, Yang Jie <yonj1e@163.com> wrote:
my question is not split the data into individual attributes.
I want to see the data in the table, but I don't want to be a bytea type.

What's wrong with simply using an SQL query?

--
Peter Geoghegan

In reply to: Yang Jie (#5)
Re: user-friendliness improvement of pageinspect

On Tue, Jul 10, 2018 at 6:55 PM, Yang Jie <yonj1e@163.com> wrote:

Simple queries are fine, but pageinspect can query previous data. If you
return the same result as a simple query, this is similar to the oracle
flashback version query.

Please don't top-post.

That may be true in some limited sense, but querying old data like
that seems totally impractical. You might do something like that for
forensic purposes, as a once off thing, but you didn't say anything
about your high level goals here.

--
Peter Geoghegan