Re: multiple tables got corrupted

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: multiple tables got corrupted
Дата
Msg-id 20200924214628.GA22855@momjian.us
обсуждение исходный текст
Ответ на Re: multiple tables got corrupted  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-general
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




В списке pgsql-general по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Need explanation on index size
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Can I get some PostgreSQL developer feedback on these five general issues I have with PostgreSQL and its ecosystem?