Introduction of a new field in pg_class indicating presence of a large object in a table

From: Gaurav Pant <gauravpant145(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Cc: Gaurav Pant <gauravpant145(at)gmail(dot)com>
Subject: Introduction of a new field in pg_class indicating presence of a large object in a table
Date: 2024-04-30 18:56:41
Message-ID: CAG53p5L7=K7qOCneELDCyLQ4oZcd3d8EWhrEHpzav-zHNM+RZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi All,

I hope you're all doing well!

Recently, I have across a scenario where one of our client was unable to
perform a major version upgrade of their PostgreSQL instance as it was
failing due to OOM errors. When reviewed the upgrade log files and queried
pg_largeobject_metadata, we found a significant number of large objects
(more than a million) due to which the upgrade seems to fail. As the client
had a different vendor in the past, they are unsure of why large objects
were created in the first place. However, in order to further dive deep,
the requirement is to identify the tables (and the columns) which contain
these large objects to decide on the next steps. I checked for online
resources but could not find any information that helps in this regard.

Although quite different from the above specified use case, pg_class does
contain a field: 'reltoastrelid' that helps us to identify the presence of
a toast table for any relation in PostgreSQL. I wanted to know if there is
any such system table that we can use to identify and map the fields
containing large objects and the respective tables and if it is not already
there, do we have any plans to incorporate the same in pg_class like we
have for pg_toast?

Thanks and Regards,
Gaurav Pant

Responses

Browse pgsql-general by date

  From Date Subject
Next Message David G. Johnston 2024-04-30 19:13:52 Re: Introduction of a new field in pg_class indicating presence of a large object in a table
Previous Message Dimitris Zenios 2024-04-30 11:10:39 Re: pg_notify contention