Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id BD2251337B92 for ; Tue, 19 Apr 2011 16:03:33 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 69271-04 for ; Tue, 19 Apr 2011 19:03:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-vx0-f174.google.com (mail-vx0-f174.google.com [209.85.220.174]) by mail.postgresql.org (Postfix) with ESMTP id AF7191337BDF for ; Tue, 19 Apr 2011 16:03:15 -0300 (ADT) Received: by vxi39 with SMTP id 39so4574vxi.19 for ; Tue, 19 Apr 2011 12:03:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=CgB2kOAsq7PAze8vRfDMF7WCtHmE/3giNX38f7A09XE=; b=ESjR10BAFTx1j1jrdOzpPsz4XLeFFFeapIrkyzj23343Vt0NK1hEz67JfgovVw8z7r cAu0JBolx4xZejiGaQXdqs9IzI/XImYRQm1snUSNWYTkkOPU4jLtAojP2n32n18iPiW1 JV0sMRDJwJVQ2VxV807USt71aWhICzDquRhOY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=uFqC6eqNWkmdPxxhya3atZVHtiqqRGFb6/DvoHKYpAeOQsQr8mj0apUAdb8cLPtnQu N1XFWeP3egRW+YHrVBA7OKIKHm3qdEK3agKxl0R1uiDDP8FEOzkGP7oYQ6STpUwknSPe FIa2cBaZ+nL9U/nhDkbK/gtZ/Vw5p6tvyeywA= MIME-Version: 1.0 Received: by 10.52.175.8 with SMTP id bw8mr252293vdc.12.1303239795198; Tue, 19 Apr 2011 12:03:15 -0700 (PDT) Received: by 10.52.183.35 with HTTP; Tue, 19 Apr 2011 12:03:15 -0700 (PDT) In-Reply-To: <24596.1303193552@sss.pgh.pa.us> References: <201104182131.p3ILVed6061175@wwwmaster.postgresql.org> <24596.1303193552@sss.pgh.pa.us> Date: Tue, 19 Apr 2011 12:03:15 -0700 Message-ID: Subject: Re: BUG #5985: CLUSTER ... USING can fail with ERROR: index xxx does not belong to table yyy From: Dewin To: Tom Lane Cc: pgsql-bugs@postgresql.org Content-Type: multipart/alternative; boundary=20cf3071c8280ccd0e04a14a297b X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.897 tagged_above=-5 required=5 tests=BAYES_00=-1.9, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001 X-Spam-Level: X-Archive-Number: 201104/139 X-Sequence-Number: 30058 --20cf3071c8280ccd0e04a14a297b Content-Type: text/plain; charset=ISO-8859-1 But if that theory is correct, this isn't a new > problem in 9.1, it goes back to 8.3. Have you been running this script > successfully on older versions? > On 9.0. Though... now that I think about it, I found a bug with the script itself (I was braindead when I wrote the commandline parser and -pvx did not mean -p -v -x) that was causing it to not always wrap files in transaction blocks when it was told to, so it is *possible* 9.0 would be likewise affected... since the problem only is visible when the index is touched in the same transaction. I don't have the means to test against it right now, however. > > I'm not sure how much we can do to fix this without abandoning the HOT > optimization, which seems unlikely to go over well. We can certainly > get it to produce a more helpful error message, and we could very likely > avoid the failure in more cases than we do now, but in the end it > remains the case that a newly-built index isn't necessarily usable right > away, and CLUSTER requires the index to be usable --- else you might > lose some rows. > > regards, tom lane > --20cf3071c8280ccd0e04a14a297b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable But if that theory is correct, this isn't a new
problem in 9.1, it goes back to 8.3. =A0Have you been running this script successfully on older versions?

On 9.0.

Tho= ugh... now that I think about it, I found a bug with the script itself (I w= as braindead when I wrote the commandline parser and -pvx did not mean -p -= v -x) that was causing it to not always wrap files in transaction blocks wh= en it was told to, so it is *possible* 9.0 would be likewise affected... si= nce the problem only is visible when the index is touched in the same trans= action.=A0 I don't have the means to test against it right now, however= .

I'm not sure how much we can do to fix this without abandoning the HOT<= br> optimization, which seems unlikely to go over well. =A0We can certainly
get it to produce a more helpful error message, and we could very likely avoid the failure in more cases than we do now, but in the end it
remains the case that a newly-built index isn't necessarily usable righ= t
away, and CLUSTER requires the index to be usable --- else you might
lose some rows.

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0regards, tom lane

--20cf3071c8280ccd0e04a14a297b--