[PATCH] Support reading large objects with pg_read_all_data

From: Nitin Motiani <nitinmotiani(at)google(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: [PATCH] Support reading large objects with pg_read_all_data
Date: 2026-02-05 09:56:02
Message-ID: CAH5HC96dxAEvP78s1-JK_nDABH5c4w2MDfyx4vEWxBEfofGWsw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
v1-0001-Support-large-object-functions-with-pg_read_all_d.patch application/x-patch 1.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2026-02-05 10:21:23 Re: Add expressions to pg_restore_extended_stats()
Previous Message Ants Aasma 2026-02-05 09:23:15 Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?