Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebrKB-0005tv-I3 for pgsql-general@arkaria.postgresql.org; Wed, 17 Jan 2018 17:16:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebrKA-0001CU-SY for pgsql-general@arkaria.postgresql.org; Wed, 17 Jan 2018 17:16:30 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ebrKA-0001CK-Hw for pgsql-general@lists.postgresql.org; Wed, 17 Jan 2018 17:16:30 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ebrK3-0002tr-Un for pgsql-general@postgresql.org; Wed, 17 Jan 2018 17:16:29 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w0HHGJAm007633; Wed, 17 Jan 2018 12:16:19 -0500 From: Tom Lane To: adsj@novozymes.com (Adam =?utf-8?Q?Sj=C3=B8gren?=) cc: pgsql-general@postgresql.org Subject: Re: ERROR: unexpected chunk number 0 (expected 1) for toast value 76753264 in pg_toast_10920100 In-reply-to: <874lnlc6ja.fsf@tullinup.koldfront.dk> References: <7pefuv53dl.fsf@novozymes.com> <871siqcdjh.fsf@tullinup.koldfront.dk> <87efmpllwg.fsf@tullinup.koldfront.dk> <20180117025021.GA39977@paquier.xyz> <874lnlc6ja.fsf@tullinup.koldfront.dk> Comments: In-reply-to adsj@novozymes.com (Adam =?utf-8?Q?Sj=C3=B8gren?=) message dated "Wed, 17 Jan 2018 08:02:01 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7631.1516209379.1@sss.pgh.pa.us> Date: Wed, 17 Jan 2018 12:16:19 -0500 Message-ID: <7632.1516209379@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk adsj@novozymes.com (Adam =?utf-8?Q?Sj=C3=B8gren?=) writes: > Also, the error we are getting is now: "unexpected chunk number 2 > (expected 3) for toast value 1498303849 in pg_toast_10919630", where > previously we've only seen "unexpected chunk number 0 (expected 1)". > We are kind of at a loss, so any suggestions on what we could try are > welcome. The basic thrust of these messages is "I'm reading what should be sequentially numbered data chunks for this toast OID, and the sequence numbers are wrong". Both of these instances could be explained by duplicate toast rows (or duplicate index entries pointing at one row), though of course that would just move to the next question of how it got that way. Anyway, you could move the investigation along with some manual checking into what's in that toast table. For instance select chunk_id, chunk_seq, ctid, xmin, xmax, length(chunk_data) from pg_toast.pg_toast_10919630 where chunk_id = 1498303849 order by 1,2; might be informative. If you do see what seem to be duplicate chunk_seq values, checking whether they're still there in a seqscan would be good. regards, tom lane