Re: When are largobject records TOASTed into pg_toast_2613?

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Thomas Boussekey <thomas(dot)boussekey(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: When are largobject records TOASTed into pg_toast_2613?
Date: 2020-08-21 13:10:30
Message-ID: 1a95b14a9534ec2a88da574931fca808d8bb74da.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2020-08-21 at 14:00 +0200, Thomas Boussekey wrote:
> Working on a PostgreSQL 9.5 to 12 upgrade, I encounter problems on a PostgreSQL instance when I have
> an existing table `pg_toast_2613` into my application database.
>
> The upgrade process fails with the following error:
>
> ```
> No match found in new cluster for old relation with OID 16619 in database "mirakl_db": "pg_toast.pg_toast_2613" which is the TOAST table for "pg_catalog.pg_largeobject"
> No match found in new cluster for old relation with OID 16621 in database "mirakl_db": "pg_toast.pg_toast_2613_index" which is an index on "pg_toast.pg_toast_2613" which is the TOAST table for
> "pg_catalog.pg_largeobject"
> ```
>
> The `pg_upgrade` command fails when I have the table `pg_toast_2613` that exists, even if it is empty.
> I read the PostgreSQL documentation, and I didn't find when the pg_largeobject table needs to be toasted.
> I thought it might be linked with records' size, but my queries below don't correlate that!

Indeed, system tables have no TOAST tables in PostgreSQL, so I wonder
how your "pg_largeobject" table could have grown one.

Did you do any strange catalog modifications?

The safest way would be to upgrade with pg_dumpall/psql.
That should get rid of that data corruption.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2020-08-21 13:14:41 Re: is date_part immutable or not?
Previous Message Laurenz Albe 2020-08-21 13:00:59 Creating many tables gets logical replication stuck