Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jFMYt-0005Tm-Hx for pgsql-general@arkaria.postgresql.org; Fri, 20 Mar 2020 18:40:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jFMYq-0005R8-QR for pgsql-general@arkaria.postgresql.org; Fri, 20 Mar 2020 18:40:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jFMYq-0005R1-BF for pgsql-general@lists.postgresql.org; Fri, 20 Mar 2020 18:40:00 +0000 Received: from mout.gmx.net ([212.227.17.20]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jFMYn-00042T-EG for pgsql-general@lists.postgresql.org; Fri, 20 Mar 2020 18:39:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1584729592; bh=20/yvllX1WzZkkKCdEalL0dZ7BXMogVuQ6oq36DvDwA=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=g/Hg89u2EWYl9CR6lQOmcbH6lK3klccgksBbIunTNAQZKuWrQp+Qe8CQY+OHXL6Pi LJNW0XlceSvEHmzM//Y7WxRuHpIjueuPDl/qzgo6SoTkCzhKU1UpF17ivvw31bfBuC WAumn1Q8JtHnw+Z41kip/+nbCux++aWzq7a020So= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from hermes ([84.190.228.15]) by mail.gmx.com (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MPGVx-1iuGEc3iaD-00PaU8; Fri, 20 Mar 2020 19:39:52 +0100 Received: from ncq by hermes with local (Exim 4.92) (envelope-from ) id 1jFMYe-0005Nf-Ae; Fri, 20 Mar 2020 19:39:48 +0100 Date: Fri, 20 Mar 2020 19:39:48 +0100 From: Karsten Hilbert To: Tom Lane Cc: pgsql-general@lists.postgresql.org Subject: Re: unexpected chunk number 2 (expected 0) for toast value ... in pg_toast_18536 Message-ID: <20200320183948.GG1535@hermes.hilbert.loc> References: <20200315182349.GL467@hermes.hilbert.loc> <20200315192037.GM467@hermes.hilbert.loc> <3b7214bd-d0b5-e66f-fd29-240f1eb56cdf@aklaver.com> <20200315202100.GO467@hermes.hilbert.loc> <537b5f42-efb7-6833-3c10-d2cf7cd05496@aklaver.com> <20200315221433.GQ467@hermes.hilbert.loc> <23239.1584317478@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23239.1584317478@sss.pgh.pa.us> Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) User-Agent: Mutt/1.10.1 (2018-07-13) Sender: X-Provags-ID: V03:K1:el4hMaimeJ+Ue/9GGvK9P258zZuUKwHWFqAqGNn2bubGbxxgidi Eq5uAjKz6/BQEtFmMJepifRSP/sxOJ38rFZbA3rXpv5gKDgx0AyQ8VZQN6/iOgdM4l6xyRx MUFJYIRo7UtH5k582EfzPCh/ty3tcxN2M6taH/knten6AoF8UI7a36qIsnaSampDfDTQX2L meN+kQ/zFK47Hd6ijTZ7A== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:zJHM6sA65a0=:gha62+4EGlonryN8JK2xE4 S1Ey0QiXT/ahBsn19o+CYmgAvjAFyUUQOJkluxJtDCrvmKDOWN8SwV+Z9da5ArCSDgA13IKqb xv313DTAiTio8B9NvmScwicN4izmQ8IlUoKEN0+y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P04yLNweZ/TIlq6Gsr99eVWhy4Yym5sjA9VSkYF03jDolH 4UQfkbn38zDnMI95r Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Mar 15, 2020 at 08:11:18PM -0400, Tom Lane wrote: > Karsten Hilbert writes: > >>> According to > >>> http://www.databasesoup.com/2013/10/de-corrupting-toast-tables.html > >>> an UPDATE of the row is recommended -- should that work > >>> better than a DELETE ? > > > OK, got that. What I now don't understand is how the UPDATE > > won't have to touch the TOAST table when the TOASTed value > > *is* UPDATEd: > > update blobs.doc_obj set data =3D '' where pk =3D the_faulty_row; > > (data is the BYTEA column) > > It makes no sense to me either; I wonder if Josh's recipe ever > really worked? But it's clearly not working now, and that's > what I'd expect, because any mechanism for removing the busted > toast reference is going to cause the system to try to mark > the toast rows deleted. > > Since you reindexed the toast table and it still doesn't find > the missing chunks, The user has reported that gratuitious and repeated use of REINDEX/VACUUM has eventually led to a consistent database. That one row went missing but can be re-created. Unfortunately, I neither have the original data for testing (it is a medical record database and the client won't hand out copies for obvious reasons) nor can I ascertain the exact order of steps they eventually took. For the record. Thanks, Karsten =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B