Re: PROPERTY GRAPH pg_dump ACL minimization

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Noah Misch <noah@leadboat.com>
Cc: pgsql-hackers@postgresql.org
Date: 2026-07-06T16:40:05Z
Lists: pgsql-hackers
On Mon, Jun 29, 2026 at 10:33 PM Noah Misch <noah@leadboat.com> wrote:
> pg_dump doesn't do its normal ACL minimization for the new PROPERTY GRAPH
> feature.  Patch attached.  See log message for details.
>
> Most of the patch bulk (modest as it is) exists to keep support for dumping
> from beta1.  I'm not sure whether it was worth bothering.  Breaking dump from
> a beta is without precedent known to me, so I just erred on the side of not
> breaking it.  If we were to decide pg_dump could drop support for betas, I'd
> be fine with that.

Thanks for catching this, Noah.

While reviewing this patch, I wondered whether quoteAclUserName()
exactly matches what the server would do. It has this dire warning:

        /* This test had better match what putid() does */

It doesn't any more, quite, because quoteAclUserName() uses this test:

!isalnum((unsigned char) *src) && *src != '_'

And putid uses this test:

!is_safe_acl_char(*src, false)

The difference between the two is that is_safe_acl_char(c) will return
false for any bytes where IS_HIGHBIT_SET(c) returns true. So consider:

CREATE ROLE álvaro;
CREATE PROPERTY GRAPH herrera;
ALTER PROPERTY GRAPH herrera OWNER TO álvaro;
GRANT SELECT ON PROPERTY GRAPH herrera TO PUBLIC;

In a UTF8 database, everything is fine. But with encoding = LATIN1 and
lc_ctype = en_US.ISO8859-1, pg_class.relacl is display with quotes
around álvaro, and the string pg_dump synthesizes lacks them. This
doesn't seem to cause a functional problem, because the ACLs are not
directly compared -- they get parsed first, and that undoes the
quoting. It seems a tad fragile, maybe, but perhaps not worth worrying
about. It's also not really the fault of this patch anyway, but it was
the only thing I found while looking through this, so I figured I
would mention it.

--
Robert Haas
EDB: http://www.enterprisedb.com