Re: pg_upgrade not preserving comments on predefined roles - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_upgrade not preserving comments on predefined roles
Date
Msg-id 3726343.1619997927@sss.pgh.pa.us
Whole thread Raw
In response to pg_upgrade not preserving comments on predefined roles  (Chapman Flack <chap@anastigmatix.net>)
Responses Re: pg_upgrade not preserving comments on predefined roles
List pgsql-hackers
Chapman Flack <chap@anastigmatix.net> writes:
> Is there an inherent technical or policy reason for pg_upgrade not to
> preserve comments on predefined roles (or on predefined objects generally)?

I think this is absolutely out of scope for pg_dump.  We generally expect
that system objects' properties are not dumped, because they might be
different in a newer version, and overwriting the system definition with
a possibly-obsolete version would be a bad thing.

You could quibble about comments being a different matter, but I don't
buy it.

Also, our one venture into this space (allowing custom modifications of
system-object privileges to be propagated by pg_dump) has IMV been an
unmitigated disaster.  Years later, it *still* has unresolved bugs and
definitional issues.  So I'm going to run away screaming from any proposal
to do likewise for other object properties.

> For that matter, would it be objectionable for the predefined roles to
> come with comments right out of the box?

That, however, seems reasonable enough.  We deliver built-in functions and
operators with comments, so why not roles?

> Another objection might be that they'd presumably be subject to translation,
> and would need some way for initdb to install the proper localized versions.

We've not worried about that for functions/operators.

> I've appended the comments we use for them at $work, anyway.

IMO these would have to be shortened quite a bit to be friendly for
"\du+" displays.  I'm not against the concept though.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Chapman Flack
Date:
Subject: pg_upgrade not preserving comments on predefined roles
Next
From: Thomas Munro
Date:
Subject: Re: WIP: WAL prefetch (another approach)