Erik Rijkers wrote:

> After a  --data-checksums initdb (successful), the following error came up:
> 
> after the statement: create index t_minmax_idx on t using minmax (r);
> 
> WARNING:  page verification failed, calculated checksum 25951 but expected 0
> ERROR:  invalid page in block 1 of relation base/21324/26267_vm
> 
> it happens reliably. every time I run the program.

Thanks for the report.  That's fixed with the attached.

> Below is the whole program that I used.

Hmm, this test program shows that you're trying to use the index to
optimize min() and max() queries, but that's not what these indexes do.
You will need to use operators > >= = <= < (or BETWEEN, which is the
same thing) to see your index in action.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
commit 762ebb8f6ecfb36b9976bb9aa87d0a7f8fb601b4
Author: Alvaro Herrera <alvhe...@alvh.no-ip.org>
Date:   Wed Sep 25 17:03:28 2013 -0300

    Set checksum to new revmap pages
    
    per Erik Rijkers

diff --git a/src/backend/access/minmax/mmrevmap.c b/src/backend/access/minmax/mmrevmap.c
index 43bff95..5ff5ca2 100644
--- a/src/backend/access/minmax/mmrevmap.c
+++ b/src/backend/access/minmax/mmrevmap.c
@@ -323,6 +323,7 @@ mmRevmapExtend(mmRevmapAccess *rmAccess, BlockNumber blkno)
 	while (blkno >= rmAccess->physPagesInRevmap)
 	{
 		extended = true;
+		PageSetChecksumInplace(page, blkno);
 		smgrextend(rmAccess->idxrel->rd_smgr, MM_REVMAP_FORKNUM,
 				   rmAccess->physPagesInRevmap, page, false);
 		rmAccess->physPagesInRevmap++;
-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to