Skip site navigation (1) Skip section navigation (2)

Re: 8.4.0 data loss / HOT-related bug

From: Radoslaw Zielinski <radek(at)pld-linux(dot)org>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: 8.4.0 data loss / HOT-related bug
Date: 2009-08-23 08:44:43
Message-ID: 20090823084443.GB2592@bzium (view raw or flat)
Thread:
Lists: pgsql-bugs
Greg Stark <gsstark(at)mit(dot)edu> [2009-08-23 03:44]:
> 2009/8/22 Radoslaw Zielinski <radek(at)pld-linux(dot)org>:
>>  $ seq 11 | xargs -ti psql bug -c "select {}, (x).* from (select bt_page_items('promocje_pkey',{}) as x ) as y"
>>  [...]
>>  psql bug -c select 11, (x).* from (select bt_page_items('promocje_pkey',11) as x ) as y
>>  ERROR:  block number out of range

> Sorry, I forgot to adjust the index name in the example. We don't want
> the primary key index of your table we want the index of the toast
> table.

Sorry, I got confused by the index not being shown in \d pg_toast.pg_toast_29644.

> Try the same thing with bt_page_items('pg_toast.pg_toast_29644_index',...)

bug=# select * from bt_page_items('pg_toast.pg_toast_29644_index', 8) where data ~ 'a5 d7 01 00';
-[ RECORD 1 ]-----------------------
itemoffset | 121
ctid       | (458,3)
itemlen    | 16
nulls      | f
vars       | f
data       | a5 d7 01 00 00 00 00 00

Full output, without the WHERE: http://radek.cc/promocje_bpi2.txt.gz
get_raw_page( 'pg_toast.pg_toast_29644', 458 ): http://radek.cc/toast_29644_page_458.txt

bug=# select * from heap_page_items( get_raw_page( 'pg_toast.pg_toast_29644', 458 ) );
 lp | lp_off | lp_flags | lp_len | t_xmin | t_xmax | t_field3 | t_ctid  | t_infomask2 | t_infomask | t_hoff | t_bits | t_oid 
----+--------+----------+--------+--------+--------+----------+---------+-------------+------------+--------+--------+-------
  1 |   6156 |        1 |   2036 |   3816 |      0 |        1 | (458,1) |           3 |       2306 |     24 |        |      
  2 |   4176 |        1 |   1979 |   3816 |      0 |        1 | (458,2) |           3 |       2306 |     24 |        |      
  3 |      0 |        3 |      0 |        |        |          |         |             |            |        |        |      
  4 |   2140 |        1 |   2036 |   3823 |      0 |        0 | (458,4) |           3 |       2306 |     24 |        |      
(4 rows)

bug=# select * from bt_page_stats('pg_toast.pg_toast_29644_index', 8);
-[ RECORD 1 ]-+-----
blkno         | 8
type          | l
live_items    | 366
dead_items    | 1
avg_item_size | 16
page_size     | 8192
free_size     | 808
btpo_prev     | 7
btpo_next     | 9
btpo          | 0
btpo_flags    | 65

-- 
Radosław Zieliński <radek(at)pld-linux(dot)org>

In response to

pgsql-bugs by date

Next:From: Andrew GierthDate: 2009-08-23 08:53:30
Subject: Re: 8.4.0 data loss / HOT-related bug
Previous:From: Radoslaw ZielinskiDate: 2009-08-23 08:00:25
Subject: Re: 8.4.0 data loss / HOT-related bug

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group