PostgreSQL allows to store binary string as bytea data type or as a large object.
• Maximum size per string: 1 GB for bytea, 4 TB for large object.
• bytea is a regular table column, large objects must be stored in the single system table named pg_largeobject.
• Only large objects have special methods to read or write only a slice of a string.
ERM's /erm/files API uses pg_largeobject to store files (PDFs).
The maximum upload size is 200 MB.
The special features of pg_argeobject (size > 1 GB, processing only a slice of a string) are not used.
ERM's /erm/files API sets the owner of the large objects to "folio"; this is a security risk. Most FOLIO modules use a dedicated PostgreSQL role for each tenant and module combination to restrict access and to enforce tenant and module separation.
https://www.postgresql.org/docs/current/lo-intro.html says that the TOAST feature (allowing up to 1 GB for bytea) "makes the large object facility partially obsolete".
Large objects make database maintenance (backup and restore) more difficult and error-prone because the large objects of all tenants and modules are mixed in the single system table pg_largeobject.
Migrate the large objects into a regular bytea column.