Re: pg_upgrade failure on Windows Server - Mailing list pgsql-bugs

From Asif Naeem
Subject Re: pg_upgrade failure on Windows Server
Date
Msg-id CAEB4t-NLYHDET3cBM4vAqRJ-giBU0wuGag4SfdjB=KuZe2Z41Q@mail.gmail.com
Whole thread Raw
In response to Re: pg_upgrade failure on Windows Server  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: pg_upgrade failure on Windows Server  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-bugs
Thank you Michael. Good suggestion, PFA updated patch, it don't have dependency on "progname" global variable any more and expecting this value as related function argument.

Regards,
Muhammad Asif Naeem

On Thu, Mar 5, 2015 at 11:37 AM, Michael Paquier <michael.paquier@gmail.com> wrote:
On Wed, Mar 4, 2015 at 10:53 PM, Asif Naeem wrote:
> On Mon, Mar 2, 2015 at 9:42 AM, Michael Paquier wrote:
>>
>> The portion for initdb to make it use restricted tokens has been added
>> some time ago with fc9c20e, and the one of pg_ctl with a25cd81, both
>> of them in 2006, so instead of duplicating again the logic for
>> pg_upgrade and pg_resetxlog, shouldn't we create a common routine in
>> src/common and link to it all the frontend binaries that need it?
>> Hence, Asif, could you refactor first the existing code and make it
>> use a new API in libpqcommon?
>
> Sure. PFA patch, restricted token code is moved to
> src/common/restricted_token.c, Now it uses common routine for initdb,
> pg_upgrade and pg_resetxlog. Please do let me know if I missed something or
> more information is required. Thanks.

Thanks. This looks fine to me (tested on MinGW-32 and MSVC). I just
have one comment: get_restricted_token should use progname as
argument. This way you can just keep progname as a static variable for
each frontend and not play with constant variables in both code paths,
aka src/common and src/bin stuff.

Regards,
--
Michael

Attachment

pgsql-bugs by date:

Previous
From: m40636067@gmail.com
Date:
Subject: BUG #12853: Cannot install
Next
From: Ronan Dunklau
Date:
Subject: PGDump / copy bugs with "big lines" ?