Re: BUG #11090: Unclear error message in pg_upgrade

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, David G Johnston <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #11090: Unclear error message in pg_upgrade
Date: 2014-07-30 02:33:17
Message-ID: 15100.1406687597@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Bruce Momjian <bruce(at)momjian(dot)us> writes:
> What I think you actually can do is to run pg_upgrade with a user that
> is not the install user in either cluster, as long as the oids match. I
> am afraid any more specific message could technically be wrong in some
> rare cases.

I think you missed my point. I'm suggesting actually restricting what
pg_upgrade will accept, so that the error conditions become simpler to
understand.

Furthermore, if your description of the restrictions is accurate, then
restricting to "the user must be the bootstrap superuser in both clusters"
is actually not an extra restriction. You said:

> o only one user can be defined in the new cluster (most likely the
> install user)

If there is only one user in the new cluster, it *is* the bootstrap
superuser, because that user cannot be deleted.

> o the oids of the two users must be the same (likely the install user
> on the old cluster as well)

If the OIDs are the same, then the old-cluster user is also the bootstrap
superuser, because the bootstrap superuser's hard-wired OID is 10. QED.

So I think you should get rid of the existing error check and simplify it
to "user must be bootstrap superuser (ie, OID 10) in both clusters".
The existing approach adds only confusion, not flexibility.

> What I think you actually can do is to run pg_upgrade with a user that
> is not the install user in either cluster, as long as the oids match.

I don't think you actually can, and if you could, I frankly would not
trust the results.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G Johnston 2014-07-30 03:31:01 Re: BUG #11090: Unclear error message in pg_upgrade
Previous Message Bruce Momjian 2014-07-30 02:08:19 Re: BUG #11090: Unclear error message in pg_upgrade