Uploaded image for project: 'ERM Platform'
  1. ERM Platform
  2. ERM-1779

Convert PDF pg_largeobject into bytea

    XMLWordPrintable

    Details

    • Template:
    • Development Team:
      ERM

      Description

      PostgreSQL allows to store binary string as bytea data type or as a large object.
      https://www.postgresql.org/docs/current/lo-intro.html

      Differences:
      • 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.

      Task:
      Migrate the large objects into a regular bytea column.

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases