On Tue, Sep 15, 2020 at 07:58:39PM +0200, Magnus Hagander wrote:
> Try reading them "row by row" until it breaks. That is, SELECT * FROM ... LIMIT
> 1, then LIMIT 2 etc. For more efficiency use a binary search starting at what
> seems like a reasonable place looking at the size of the table vs the first
> failed block to make it faster, but the principle is the same. Once it fails,
> you've found a corrupt block...
You can also include the invisible 'ctid' column so you can see the
block number of each row, e.g.:
SELECT ctid, relname FROM pg_class LIMIT 2;
ctid | relname
--------+--------------
(0,46) | pg_statistic
(0,47) | pg_type
The format is page number, item number on page.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EnterpriseDB https://enterprisedb.com
The usefulness of a cup is in its emptiness, Bruce Lee