pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeremy Schneider <schneider@ardentperf.com>
To: Nick Renders <postgres@arcict.com>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: PL/pgSQL question about EXCEPTION clause & corrupt records
Date: Mon, 17 Feb 2020 10:17:26 -0800
Message-ID: <778b4c5c-312f-2e64-b690-5ddc9443966b@ardentperf.com> (raw)
In-Reply-To: <BB879D78-40C8-4D92-8A15-F1F0CCD40DEB@ardentperf.com>
References: <4C495833-29AC-47F8-ADB7-D32E2A1F516F@arcict.com>
	<BB879D78-40C8-4D92-8A15-F1F0CCD40DEB@ardentperf.com>

On 2/17/20 08:23, Jeremy Schneider wrote:
> FWIW, Bertrand blogged an even faster way to do this about a month ago -
> using pageinspect and processing blocks instead of rows
> 
> https://bdrouvot.wordpress.com/2020/01/18/retrieve-postgresql-variable-length-storage-information-th...
> 
> 
>> On Feb 17, 2020, at 03:32, Nick Renders <postgres@arcict.com> wrote:
>>
>> The problem is that I don't know which column is corrupt. But I found
>> a solution: by simply copying the record into another variable, the
>> values are parsed and the TOAST errors are thrown.
>>
>> In case anyone's interested, here's my code, based on an example from
>> http://www.databasesoup.com/2013/10/de-corrupting-toast-tables.html

Apologies - sent that slightly rushed email while I was taking the bus
to the office this morning and linked the wrong blog post :D

Here's the right one, showing a much faster way to identify which tuple
links to a bad toast row:

https://bdrouvot.wordpress.com/2020/01/04/get-toast-chunk_id-from-the-user-table-tuples-or-from-the-...

-Jeremy

-- 
http://about.me/jeremy_schneider





view thread (8+ messages)

Message-ID: <778b4c5c-312f-2e64-b690-5ddc9443966b@ardentperf.com>
Permalink:  ../778b4c5c-312f-2e64-b690-5ddc9443966b@ardentperf.com/
Also on:    postgresql.org/message-id/778b4c5c-312f-2e64-b690-5ddc9443966b@ardentperf.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: schneider@ardentperf.com, postgres@arcict.com
  Subject: Re: PL/pgSQL question about EXCEPTION clause & corrupt records
  In-Reply-To: <778b4c5c-312f-2e64-b690-5ddc9443966b@ardentperf.com>
  References: <4C495833-29AC-47F8-ADB7-D32E2A1F516F@arcict.com> <BB879D78-40C8-4D92-8A15-F1F0CCD40DEB@ardentperf.com> <778b4c5c-312f-2e64-b690-5ddc9443966b@ardentperf.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox