Thread: user-friendliness improvement of pageinspect

user-friendliness improvement of pageinspect

From
杨杰
Date:
font{ line-height: 1.6; } ul,ol{ padding-left: 20px; list-style-position: inside; }
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.
a#ntes-pcmail-signature-default:hover { text-decoration: underline; color: #199cff; cursor: pointer; } a#ntes-pcmail-signature-default:active { text-decoration: underline; color: #246fce; cursor: pointer; }
font{ line-height: 1.6; }
font{ line-height: 1.6; }
font{ line-height: 1.6; }

Re: user-friendliness improvement of pageinspect

From
Peter Geoghegan
Date:
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


回复: user-friendliness improvement of pageinspect

From
"Yang Jie"
Date:
font{ line-height: 1.6; } ul,ol{ padding-left: 20px; list-style-position: inside; }
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.



a#ntes-pcmail-signature-default:hover { text-decoration: underline; color: #199cff; cursor: pointer; } a#ntes-pcmail-signature-default:active { text-decoration: underline; color: #246fce; cursor: pointer; }
font{ line-height: 1.6; }
font{ line-height: 1.6; }
font{ line-height: 1.6; }

2018年7月11日 02:48Peter 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

Re: user-friendliness improvement of pageinspect

From
Peter Geoghegan
Date:
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


Re: user-friendliness improvement of pageinspect

From
"Yang Jie"
Date:
font{ line-height: 1.6; } ul,ol{ padding-left: 20px; list-style-position: inside; }
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.

a#ntes-pcmail-signature-default:hover { text-decoration: underline; color: #199cff; cursor: pointer; } a#ntes-pcmail-signature-default:active { text-decoration: underline; color: #246fce; cursor: pointer; }
font{ line-height: 1.6; }
font{ line-height: 1.6; }
font{ line-height: 1.6; }

On 7/11/2018 09:51Peter 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

Re: user-friendliness improvement of pageinspect

From
Peter Geoghegan
Date:
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