From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #11090: Unclear error message in pg_upgrade
Date: Tue, 29 Jul 2014 20:31:01 -0700 (PDT)
Message-ID: <1406691061869-5813246.post@n5.nabble.com> (raw)
In-Reply-To: <15100.1406687597@sss.pgh.pa.us>
References: <20140729174023.16601.48893@wrigleys.postgresql.org>
<20140729185859.GT5475@eldon.alvh.no-ip.org>
<1406666444963-5813220.post@n5.nabble.com>
<8448.1406669507@sss.pgh.pa.us>
<20140730020819.GF2791@momjian.us>
<15100.1406687597@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Tom Lane-2 wrote
> Bruce Momjian <
> bruce@
> > 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.
For the archives - the "original" complaint with detail is here:
http://www.postgresql.org/message-id/2B69ABB0-014A-4296-8D34-D2E83A84FA77@gmail.com
Basically:
1) Original database created with default "postgres" user
2) DBA decides it would be better if "bob" was the superuser
3) Create "bob" in original database (as opposed to doing a rename)
4) <assume> REASSIGN OWNED FROM postgres TO bob;
5) pg_upgrade time - decide "bob" should be doing this (totally forgot about
postgres by now)
6) DBA sees error
Note the missing piece was, for me, the fact that you cannot delete the
"postgres" user in the original database. If you could then there would be
no possible way to get oid 10 in the new cluster to match the now deleted
oid 10 in the original cluster. Once that is "frozen" then as Tom said all
of the other rules amount to the same thing - "postgres" must be the name of
the user in the new database.
NOTE: had the DBA done an "ALTER USER postgres RENAME TO bob" instead of
simply adding "bob" then everything supposedly would have worked correctly.
> "Old and new cluster must be created by the same user. Try to re-init the
> new database with the flag "-U %s" \n"
The OP's proposed message seems good to me though s/database/cluster/? Or
is there some unspoken assumption we can make at this point in the process.
David J.
--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11090-Unclear-error-message-in-pg-upgrade-tp5813198p5813...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: david.g.johnston@gmail.com
Subject: Re: BUG #11090: Unclear error message in pg_upgrade
In-Reply-To: <1406691061869-5813246.post@n5.nabble.com>
References: <20140729174023.16601.48893@wrigleys.postgresql.org> <20140729185859.GT5475@eldon.alvh.no-ip.org> <1406666444963-5813220.post@n5.nabble.com> <8448.1406669507@sss.pgh.pa.us> <20140730020819.GF2791@momjian.us> <15100.1406687597@sss.pgh.pa.us> <1406691061869-5813246.post@n5.nabble.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox