Re: pg_upgrade not preserving comments on predefined roles

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chapman Flack <chap(at)anastigmatix(dot)net>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_upgrade not preserving comments on predefined roles
Date: 2021-05-02 23:25:27
Message-ID: 3726343.1619997927@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Chapman Flack <chap(at)anastigmatix(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-05-03 01:23:25 Re: WIP: WAL prefetch (another approach)
Previous Message Chapman Flack 2021-05-02 19:52:19 pg_upgrade not preserving comments on predefined roles