| From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
| Cc: | Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Virender Singla <virender(dot)cse(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, Aniket Jha <aniketkumarj(at)gmail(dot)com> |
| Subject: | Re: Major Version Upgrade failure due to orphan roles entries in catalog |
| Date: | 2026-02-27 21:42:30 |
| Message-ID: | CA+TgmobMUVTj=5csi-vT=w731H5PBj+0SpCS_AndZEv_eum-jA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-bugs |
On Fri, Feb 27, 2026 at 4:28 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> I wrote:
> > So I end with the attached draft patch.
>
> Sigh, this time with it really attached.
I suggest that having both a variable called dump_grantor and one
called dump_grantors is a little bit subtle, but other than that this
looks good on a quick read-through.
Regarding this point:
> I'm inclined to
> think that is an overreaction to the possible unreliability of the
> data (and from your comment upthread you might agree).
I think this is my code, so I certainly believed I had the right idea
at the time, but we could revisit that. One thing to keep in mind is
that in v15-, regardless of the notional grantor, in effect all grants
are independent of the existence of any other user. In v16+, they form
a tree structure, with grants depending on their grantors. So, when
upgrading from v15- to v16+, we have to end up with a valid tree
structure, but there's absolutely no reason to think that we already
have one. If we don't, it must be better to discard the grantor than
to fail the dump-and-restore altogether. Note that it's perfectly
possible not to have a tree structure, e.g. because we have circular
grants, even if all the roles involved still exist and have existed
continuously. I believe my thought process at the time was there
wasn't really any reason to imagine that whatever we were upgrading
from v15- was intended as a tree structure, and therefore it made
logical sense to treat it as though all of those grants directly
emanated from the superuser, i.e. the tree is just 1 level deep. Now,
that does mean losing the grantor information, but we're arguably
preserving the semantics, since any it reproduces the v15- state where
any of those roles are free to be dropped (assuming no other
blockers). Anyway, again, we can rethink that, but if we do it without
repairing any structural "tree defects," we'll end up with a dump that
we can't reload on v16+.
--
Robert Haas
EDB: http://www.enterprisedb.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2026-02-27 21:52:07 | Re: Major Version Upgrade failure due to orphan roles entries in catalog |
| Previous Message | Tom Lane | 2026-02-27 21:28:51 | Re: Major Version Upgrade failure due to orphan roles entries in catalog |