[PATCH] Support reading large objects with pg_read_all_data
Nitin Motiani <nitinmotiani@google.com>
From: Nitin Motiani <nitinmotiani@google.com>
To: pgsql-hackers@postgresql.org
Date: 2026-02-05T09:56:02Z
Lists: pgsql-hackers
Attachments
- v1-0001-Support-large-object-functions-with-pg_read_all_d.patch (application/x-patch) patch v1-0001
Hi Hackers, It was reported in [1] that pg_dump for a user with pg_read_all_data fails as pg_read_all_data doesn't have the permission to read large objects. The discussion on the same thread suggested that this was an oversight as the goal of pg_read_all_data was to allow running pg_dump [2]. This patch proposes to fill that gap by modifying pg_largeobject_aclmask_snapshot to provide ACL_SELECT for the role PG_READ_ALL_DATA. Note that the patch doesn't make an equivalent change for PG_WRITE_ALL_DATA as it would effectively provide pg_write_all_data write access to a system catalog which is explicitly avoided for system catalogs Please take a look and let me know what you folks think. If this approach makes sense, I will update the corresponding docs in the patch. Thanks & Regards, Nitin Motiani Google [1] https://www.postgresql.org/message-id/19379-089536632927293f%40postgresql.org [2] https://www.postgresql.org/message-id/r5a3aqlrrqen2snktdmx5tjeoakp3hmbektlqmeqhij3fqqez4%40zmx3bdscipny
Commits
-
Allow pg_{read,write}_all_data to access large objects.
- d98197602790 19 (unreleased) landed