Re: Pb importing data in v. 7.0.3

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Herve Piedvache" <herve(at)elma(dot)fr>, "Jean-Christophe Boggio" <cat(at)thefreecat(dot)org>, "Sebastien COUREAU" <lifo(at)elma(dot)fr>
Cc: pgsql-general(at)postgresql(dot)org, pgsql-patches(at)postgresql(dot)org
Subject: Re: Pb importing data in v. 7.0.3
Date: 2001-01-04 04:43:57
Message-ID: 19965.978583437@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-patches

I wrote:
> The equal-key logic has been entirely rewritten for 7.1, and I believe
> that it's not subject to this bug any longer. I'm very hesitant to try
> to jury-rig a solution for 7.0, though

Actually, after thinking a little more, I think that the attached patch
might cure the problem in 7.0.3. Give it a try, if you like.

regards, tom lane

*** src/backend/access/nbtree/nbtsort.c.orig Wed Apr 12 13:14:49 2000
--- src/backend/access/nbtree/nbtsort.c Wed Jan 3 23:37:46 2001
***************
*** 321,327 ****
btisz,
(PageGetPageSize(npage) - sizeof(PageHeaderData) - MAXALIGN(sizeof(BTPageOpaqueData))) /3 - sizeof(ItemIdData));

! if (pgspc < btisz)
{
Buffer obuf = nbuf;
Page opage = npage;
--- 321,327 ----
btisz,
(PageGetPageSize(npage) - sizeof(PageHeaderData) - MAXALIGN(sizeof(BTPageOpaqueData))) /3 - sizeof(ItemIdData));

! while (pgspc < btisz)
{
Buffer obuf = nbuf;
Page opage = npage;
***************
*** 436,441 ****
--- 436,448 ----
* we aren't locking).
*/
_bt_wrtbuf(index, obuf);
+
+ /*
+ * Recompute pgspc and loop back to check free space again. If
+ * we were forced to split at a bad split point, we might need
+ * to split again.
+ */
+ pgspc = PageGetFreeSpace(npage);
}

/*

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Anand Raman 2001-01-04 05:57:14
Previous Message Anthony E . Greene 2001-01-04 04:41:19 Re: Problems about extracting data with cgi's

Browse pgsql-patches by date

  From Date Subject
Next Message Alex Perel 2001-01-05 15:30:52 \du in psql patchp
Previous Message Tom Lane 2001-01-04 04:25:26 Re: Pb importing data in v. 7.0.3