Re: BUG #11090: Unclear error message in pg_upgrade - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #11090: Unclear error message in pg_upgrade
Date
Msg-id 8448.1406669507@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #11090: Unclear error message in pg_upgrade  (David G Johnston <david.g.johnston@gmail.com>)
Responses Re: BUG #11090: Unclear error message in pg_upgrade  (Bruce Momjian <bruce@momjian.us>)
List pgsql-bugs
David G Johnston <david.g.johnston@gmail.com> writes:
> Alvaro Herrera-9 wrote
>> To me, the bug is that we required both superusers to be named the same
>> in the first place.

> It seems a reasonable limitation for something the simply purports to
> "upgrade".  The data should not be changed in the process.

Yeah, I wouldn't really expect pg_upgrade to deal with such a case.
For one thing, what if the new cluster's superuser name conflicts with
some non-superuser in the old cluster?

Having said that, I think the actual implementation restriction is not
that they have the same *name*, but that they have the same *OID*.
And the OID of the bootstrap superuser is always gonna be 10.  As long
as the new cluster's bootstrap superuser name doesn't collide with
any other usernames in the old cluster, it could in principle be
different.  The only difficulty is that pg_upgrade has but one -U
switch to specify both names ... and it's not exactly clear that it's
worth the complication to have two such switches.

I agree that it'd be better if the error message said something like
"you have to use the bootstrap superuser, which is 'foo' in this cluster".
That would be overconstraining the user of pg_upgrade, but not by much,
and it would be a lot easier to understand than the current situation.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #11090: Unclear error message in pg_upgrade
Next
From: Jeff Janes
Date:
Subject: Re: BUG #11090: Unclear error message in pg_upgrade