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