Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-25 Thread Michael Paquier
On Wed, Nov 25, 2015 at 10:06 PM, Teodor Sigaev wrote: > - bits_len = tuphdr->t_hoff - > - offsetof(HeapTupleHeaderData, t_bits); > + int bits_len = > + ((tuphdr->t_infomask2 & HEAP_NATTS_MASK)

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-25 Thread Nikolay Shaplov
В письме от 25 ноября 2015 22:27:57 пользователь Michael Paquier написал: > On Wed, Nov 25, 2015 at 10:16 PM, Nikolay Shaplov > wrote: > > В письме от 18 ноября 2015 15:52:54 пользователь Michael Paquier написал: > > Teodor Sigaev asked a very good question: does it

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-25 Thread Michael Paquier
On Wed, Nov 25, 2015 at 10:16 PM, Nikolay Shaplov wrote: > В письме от 18 ноября 2015 15:52:54 пользователь Michael Paquier написал: > Teodor Sigaev asked a very good question: does it properly do upgrade from > 1.3 > to 1.4 > > I've rechecked and fixed > What was

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-25 Thread Teodor Sigaev
Teodor Sigaev asked a very good question: does it properly do upgrade from 1.3 to 1.4 I've rechecked and fixed here is a patch. Committed, thank you. -- Teodor Sigaev E-mail: teo...@sigaev.ru WWW:

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-25 Thread Teodor Sigaev
- bits_len = tuphdr->t_hoff - - offsetof(HeapTupleHeaderData, t_bits); + int bits_len = + ((tuphdr->t_infomask2 & HEAP_NATTS_MASK) / 8 + 1) * 8; As I understand offline comments of Nikolay, current version of

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-25 Thread Nikolay Shaplov
В письме от 18 ноября 2015 15:52:54 пользователь Michael Paquier написал: Teodor Sigaev asked a very good question: does it properly do upgrade from 1.3 to 1.4 I've rechecked and fixed here is a patch. > On Wed, Nov 18, 2015 at 3:10 AM, Nikolay Shaplov wrote: > > Everything seems to be ok.

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-17 Thread Nikolay Shaplov
> >> I still have an opinion that documentation should be more verbose, than > >> your version, but I can accept your version. > > > > I am not sure that's necessary, pageinspect is for developers. > > > >> Who is going to add heap_page_item_attrs to your patch? me or you? > > > > I recall

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-17 Thread Guillaume Lelarge
Hi, Le 12 nov. 2015 1:05 AM, "Michael Paquier" a écrit : > > On Thu, Nov 12, 2015 at 12:41 AM, Nikolay Shaplov > wrote: > > В письме от 28 октября 2015 16:57:36 пользователь Michael Paquier написал: > >> On Sat, Oct 17, 2015 at 1:48 AM,

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-17 Thread Michael Paquier
On Wed, Nov 18, 2015 at 3:10 AM, Nikolay Shaplov wrote: > Everything seems to be ok. I've changed only one thing in your version > of the patch. I've renamed split_tuple_data to > tuple_data_split_internal, because when there are split_tuple_data and > tuple_data_split in the same file, nobody

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-11 Thread Nikolay Shaplov
В письме от 28 октября 2015 16:57:36 пользователь Michael Paquier написал: > On Sat, Oct 17, 2015 at 1:48 AM, Michael Paquier wrote: > > On Sat, Oct 17, 2015 at 5:15 AM, Nikolay Shaplov wrote: > >> Or it's ready to commit, and just not marked this way? > > > > No, I don't think we have reached

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-11 Thread Michael Paquier
On Thu, Nov 12, 2015 at 9:04 AM, Michael Paquier wrote: > On Thu, Nov 12, 2015 at 12:41 AM, Nikolay Shaplov wrote: >> I still have an opinion that documentation should be more verbose, than your >> version, but I can accept your version. > > I am not sure that's necessary, pageinspect is for

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-11-11 Thread Michael Paquier
On Thu, Nov 12, 2015 at 12:41 AM, Nikolay Shaplov wrote: > В письме от 28 октября 2015 16:57:36 пользователь Michael Paquier написал: >> On Sat, Oct 17, 2015 at 1:48 AM, Michael Paquier wrote: >> > On Sat, Oct 17, 2015 at 5:15 AM, Nikolay Shaplov wrote: >> >> Or it's

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-10-28 Thread Michael Paquier
On Sat, Oct 17, 2015 at 1:48 AM, Michael Paquier wrote: > On Sat, Oct 17, 2015 at 5:15 AM, Nikolay Shaplov wrote: >> Or it's ready to commit, and just not marked this way? > > No, I don't think we have reached this state yet. > >> I am going to make report based on this patch in Vienna. It would

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-10-16 Thread Nikolay Shaplov
So what's next? We need something else to discuss? We need somebody else's opinion to rule this out? Or it's ready to commit, and just not marked this way? I am going to make report based on this patch in Vienna. It would be nice to have it committed until then :) On 02.10.2015 07:10, Michael

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-10-16 Thread Michael Paquier
On Sat, Oct 17, 2015 at 5:15 AM, Nikolay Shaplov wrote: > So what's next? Wait and see a bit. > We need something else to discuss? > We need somebody else's opinion to rule this out? The spec of the patch looks clear to me. > Or it's ready to commit, and just not

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-10-02 Thread Nikolay Shaplov
В письме от 2 октября 2015 13:10:22 пользователь Michael Paquier написал: > >> + > >> + General idea about output columns: lp_* > >> attributes > >> + are about where tuple is located inside the page; > >> + t_xmin, t_xmax, > >> + t_field3, t_ctid are > > about > > >> +

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-10-02 Thread Nikolay Shaplov
В письме от 2 октября 2015 13:10:22 Вы написали: > > There also was a bug in original pageinspect, that did not get t_bits > > right > > > when there was OID in the tuple. I've fixed it too. > > Aha. Good catch! By looking at HeapTupleHeaderGetOid if the tuple has an > OID it will be stored

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-10-01 Thread Nikolay Shaplov
В письме от 30 сентября 2015 13:49:00 пользователь Michael Paquier написал: > > - errmsg("input page too small (%d bytes)", > raw_page_size))); > +errmsg("input page too small (%d > bytes)", raw_page_size))); > Please be

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-10-01 Thread Michael Paquier
On Thu, Oct 1, 2015 at 8:13 PM, Nikolay Shaplov wrote: > В письме от 30 сентября 2015 13:49:00 пользователь Michael Paquier написал: >> >> - errmsg("input page too small (%d bytes)", >> raw_page_size))); >> +errmsg("input page

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-29 Thread Nikolay Shaplov
В письме от 26 сентября 2015 20:57:25 пользователь Michael Paquier написал: > > So I would consider two options: Either move t_infomask/t_infomask2 > > details > > into storage.sgml or leave as it is. > > The documentation redirects the reader to look at htup_details.h (the > documentation is

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-29 Thread Michael Paquier
On Tue, Sep 29, 2015 at 11:39 PM, Nikolay Shaplov wrote: > But since now we actually parse data with tuple_data_split, we can provide a > precisely formed fake information, so you are not limited with how it is > actually stored in page. You just pass any arguments you want. So you does not >

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-28 Thread Nikolay Shaplov
В письме от 26 сентября 2015 20:57:25 Вы написали: > >> Thanks! I just had a short look at it: > >> - I am not convinced that it is worth declaring 3 versions of > >> tuple_data_split. > > > > How which of them should we leave? > > The one with the most arguments. Now perhaps we could have as

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-26 Thread Michael Paquier
On Sat, Sep 26, 2015 at 1:46 AM, Nikolay Shaplov wrote: > В письме от 25 сентября 2015 20:59:29 пользователь Michael Paquier написал: >> Thanks! I just had a short look at it: >> - I am not convinced that it is worth declaring 3 versions of >> tuple_data_split. > How which of them should we leave?

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-25 Thread Nikolay Shaplov
В письме от 11 сентября 2015 15:12:04 пользователь Michael Paquier написал: > > Ok.Let's come to the final decision with tuple_data_parse, and i will add > > this switch there and to pure sql heap_page_item_attrs > > Fine for me. Here is final version with documentation. Hope it will be the

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-25 Thread Nikolay Shaplov
В письме от 25 сентября 2015 20:59:29 пользователь Michael Paquier написал: > > Here is final version with documentation. > > Thanks! I just had a short look at it: > - I am not convinced that it is worth declaring 3 versions of > tuple_data_split. How which of them should we leave? > - The

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-25 Thread Michael Paquier
On Fri, Sep 25, 2015 at 8:30 PM, Nikolay Shaplov wrote: > Here is final version with documentation. Thanks! I just had a short look at it: - I am not convinced that it is worth declaring 3 versions of tuple_data_split. - The patch does not respect the project code style, particularly one-line "if

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-18 Thread Nikolay Shaplov
В письме от 11 сентября 2015 15:12:04 Вы написали: > > Ok.Let's come to the final decision with tuple_data_parse, and i will add > > this switch there and to pure sql heap_page_item_attrs > > Fine for me. So I've modified the code, now we have: heap_page_items - have a column with raw tuple

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-11 Thread Michael Paquier
On Fri, Sep 11, 2015 at 12:08 AM, Nikolay Shaplov wrote: > В письме от 10 сентября 2015 15:46:25 пользователь Michael Paquier написал: > >> > So if move tuple data parsing into separate function, then we have to pass >> > these values alongside the tuple data. This is

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-11 Thread Michael Paquier
On Fri, Sep 11, 2015 at 12:12 AM, Bruce Momjian wrote: > On Thu, Sep 10, 2015 at 03:46:25PM +0900, Michael Paquier wrote: >> Why is it not convenient at all? Yes, you have a point, we need those >> fields to be able to parse the t_data properly. Still the possibility >> to show

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-10 Thread Michael Paquier
On Wed, Sep 9, 2015 at 8:39 PM, Nikolay Shaplov wrote: > В письме от 8 сентября 2015 11:53:24 Вы написали: >> Hence, instead of all those complications, why not simply introducing two >> functions that take as input the tuple data and the OID of the relation, >>

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-10 Thread Bruce Momjian
On Thu, Sep 10, 2015 at 03:46:25PM +0900, Michael Paquier wrote: > Why is it not convenient at all? Yes, you have a point, we need those > fields to be able to parse the t_data properly. Still the possibility > to show individual fields of a tuple as a bytea array either with > toasted or

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-10 Thread Nikolay Shaplov
В письме от 10 сентября 2015 15:46:25 пользователь Michael Paquier написал: > > So if move tuple data parsing into separate function, then we have to pass > > these values alongside the tuple data. This is not convenient at all. > > So I did it in a way you see in the patch. > > Why is it not

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-09 Thread Nikolay Shaplov
В письме от 8 сентября 2015 11:53:24 Вы написали: > On Sat, Sep 5, 2015 at 1:05 AM, Nikolay Shaplov wrote: > > В письме от 4 сентября 2015 14:58:29 пользователь Michael Paquier написал: > > > Documentation is missing, that would be good to have to understand what > > > each function is intended to

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-07 Thread Michael Paquier
On Tue, Sep 8, 2015 at 11:53 AM, Michael Paquier wrote: > Honestly, heap_page_item_attrs and heap_page_item_detoast_attrs are way too > similar to what heap_page_items does, leading to a code maze that is going > to make future extensions more difficult, which is what lead to the > refactoring

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-07 Thread Michael Paquier
On Sat, Sep 5, 2015 at 1:05 AM, Nikolay Shaplov wrote: > В письме от 4 сентября 2015 14:58:29 пользователь Michael Paquier написал: > > Documentation is missing, that would be good to have to understand what > > each function is intended to do. > > I were going to add documentation when this

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-04 Thread Nikolay Shaplov
В письме от 4 сентября 2015 14:58:29 пользователь Michael Paquier написал: > Yeah, I think that's acceptable to have a switch, defaulting to ERROR if > caller specifies nothing. > > Here are some observations after looking at the code, no functional testing. > > + int

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-03 Thread Michael Paquier
On Wed, Sep 2, 2015 at 6:58 PM, Nikolay Shaplov wrote: > В письме от 3 августа 2015 15:35:23 пользователь Alvaro Herrera написал: > > Nikolay Shaplov wrote: > > > This patch adds several new functions, available from SQL queries. All > > > these functions are based on

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-09-02 Thread Nikolay Shaplov
В письме от 3 августа 2015 15:35:23 пользователь Alvaro Herrera написал: > Nikolay Shaplov wrote: > > This patch adds several new functions, available from SQL queries. All > > these functions are based on heap_page_items, but accept slightly > > different arguments and has one additional column

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-08-05 Thread Nikolay Shaplov
В письме от 3 августа 2015 15:35:23 Вы написали: Nikolay Shaplov wrote: This patch adds several new functions, available from SQL queries. All these functions are based on heap_page_items, but accept slightly different arguments and has one additional column at the result set:

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-08-03 Thread Nikolay Shaplov
В письме от 3 августа 2015 14:30:46 пользователь Michael Paquier написал: On Mon, Aug 3, 2015 at 1:03 AM, Nikolay Shaplov n.shap...@postgrespro.ru wrote: Hi! I've created a patch for pageinspect that allows to see data stored in the tuple. This patch has two main purposes:

Re: [HACKERS] pageinspect patch, for showing tuple data

2015-08-03 Thread Alvaro Herrera
Nikolay Shaplov wrote: This patch adds several new functions, available from SQL queries. All these functions are based on heap_page_items, but accept slightly different arguments and has one additional column at the result set: heap_page_tuples - accepts relation name, and bulkno, and

[HACKERS] pageinspect patch, for showing tuple data

2015-08-02 Thread Nikolay Shaplov
Hi! I've created a patch for pageinspect that allows to see data stored in the tuple. This patch has two main purposes: 1. Practical: Make manual DB recovery more simple 2. Educational: Seeing what data is actually stored in tuple, allows to get better understanding of how does postgres