Re: [GENERAL] pg_upgrade -u

From: Ray Stell <stellr(at)vt(dot)edu>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [GENERAL] pg_upgrade -u
Date: 2013-05-29 12:59:42
Message-ID: B185FA9D-E94F-4A61-9F0B-A023A8678637@vt.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


On May 28, 2013, at 10:55 PM, Bruce Momjian wrote:

> On Wed, May 22, 2013 at 03:05:57PM -0400, Ray Stell wrote:
>>> However, if we pass these items into the scripts, we then force
>>> these values to be used, even if the user wants to use a different
>>> value. It is a balance between supplying defaults vs. requiring the
>>> user to supply or change the values used during the ugprade.
>>>
>>> At this point, I have favored _not_ supplying defaults in the
>>> script. Do you have an alternative argument in favor of supplying
>>> defaults?
>>
>>
>>
>> Well, the story really began when I ran initdb with a -U arg. vacuumdb
>> takes the -U also, but pg_upgrade does not.
>>
>> It seems like if I have to supply a -u in order to get pg_upgrade
>> to function in the case where there is no default superuser in the
>> cluster, then an associated vacuumdb command requires a -U arg.
>>
>> Perhaps just documenting the behavior is all that is needed, but -U is
>> everywhere and I think that's a good thing.
>
> [ moved to hacker ]
>
> Wow, I never realized other tools used -U for user, instead of -u.
> Should I change pg_upgrade to use -U for 9.4? I can keep supporting -u
> as an undocumented option.

That would make for consistency, but not change the broken behavior. Comments on this below.

> I have applied the attached patch to document that you might need to set
> connection parameters for vacuumdb.

That will work as this is not a big deal, but have to admit, I didn't understand the logic you posted in your question. If the src cluster has a alternate superuser (from initdb -U), and the the pg_upgrade command has to be supplied a -u/-U in order to work with the src cluster, why would you assume somehow the output cluster has changed to the default superuser when you build the vacuum script on the other side of pg_upgrade? Is that even possible to accomplish? Your statement about "forcing the values" throws me, as it seems to me the user is requesting the variation. I have not dug into pg_upgrade's guts, so I may just be uninformed.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2013-05-29 13:42:12 Re: pg_upgrade -u
Previous Message YuChi 2013-05-29 08:57:05 Re: Help, How to start the server??

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2013-05-29 13:42:12 Re: pg_upgrade -u
Previous Message Dimitri Fontaine 2013-05-29 12:52:46 Re: pg_dump with postgis extension dumps rules separately