Thread: pgadmin III - "Display objects" part of database restore errors out in non-English locales
pgadmin III - "Display objects" part of database restore errors out in non-English locales
From
Nikhil S
Date:
Hi,
So, I changed the locale on my setup to "zh_CN.UTF-8" and tried to restore into a database using a backup from earlier. When I click on "Display objects" tab, I see an error being displayed, although the actual restore happens just fine. Note that no error occurs in English locales.
Took me a while to figure this one out. The issue is with frmRestore::OnEndProcess() function. It naively avoids lines containing ";" or "P" as the first letter. So in the English locale, the last line about the "Process returned exit code 0" is handled. However in other locales, this will be translated and hence the last line will be inspected leading to a spurious error.
The fix is to avoid inspecting the last line. The attached patch does that.
Regards,
Nikhils
So, I changed the locale on my setup to "zh_CN.UTF-8" and tried to restore into a database using a backup from earlier. When I click on "Display objects" tab, I see an error being displayed, although the actual restore happens just fine. Note that no error occurs in English locales.
Took me a while to figure this one out. The issue is with frmRestore::OnEndProcess() function. It naively avoids lines containing ";" or "P" as the first letter. So in the English locale, the last line about the "Process returned exit code 0" is handled. However in other locales, this will be translated and hence the last line will be inspected leading to a spurious error.
The fix is to avoid inspecting the last line. The attached patch does that.
Regards,
Nikhils
Attachment
Re: pgadmin III - "Display objects" part of database restore errors out in non-English locales
From
Nikhil S
Date:
Please ignore the last patch. Some unwanted debug changes in there!
Please use this one.
Regards,
Nikhils
Please use this one.
Regards,
Nikhils
On Wed, May 18, 2011 at 5:28 PM, Nikhil S <nixmisc@gmail.com> wrote:
Hi,
So, I changed the locale on my setup to "zh_CN.UTF-8" and tried to restore into a database using a backup from earlier. When I click on "Display objects" tab, I see an error being displayed, although the actual restore happens just fine. Note that no error occurs in English locales.
Took me a while to figure this one out. The issue is with frmRestore::OnEndProcess() function. It naively avoids lines containing ";" or "P" as the first letter. So in the English locale, the last line about the "Process returned exit code 0" is handled. However in other locales, this will be translated and hence the last line will be inspected leading to a spurious error.
The fix is to avoid inspecting the last line. The attached patch does that.
Regards,
Nikhils
Attachment
Re: Re: pgadmin III - "Display objects" part of database restore errors out in non-English locales
From
Dave Page
Date:
Thanks - applied. On Wed, May 18, 2011 at 12:03 PM, Nikhil S <nixmisc@gmail.com> wrote: > Please ignore the last patch. Some unwanted debug changes in there! > Please use this one. > > Regards, > Nikhils > > On Wed, May 18, 2011 at 5:28 PM, Nikhil S <nixmisc@gmail.com> wrote: >> >> Hi, >> >> So, I changed the locale on my setup to "zh_CN.UTF-8" and tried to restore >> into a database using a backup from earlier. When I click on "Display >> objects" tab, I see an error being displayed, although the actual restore >> happens just fine. Note that no error occurs in English locales. >> >> Took me a while to figure this one out. The issue is with >> frmRestore::OnEndProcess() function. It naively avoids lines containing ";" >> or "P" as the first letter. So in the English locale, the last line about >> the "Process returned exit code 0" is handled. However in other locales, >> this will be translated and hence the last line will be inspected leading to >> a spurious error. >> >> The fix is to avoid inspecting the last line. The attached patch does >> that. >> >> Regards, >> Nikhils > > > > -- > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgadmin-hackers > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Re: Re: pgadmin III - "Display objects" part of database restore errors out in non-English locales
From
Nikhil S
Date:
Thanks Dave.
Regards,
Nikhils
Regards,
Nikhils
On Thu, May 19, 2011 at 9:15 PM, Dave Page <dpage@pgadmin.org> wrote:
Thanks - applied.> --
On Wed, May 18, 2011 at 12:03 PM, Nikhil S <nixmisc@gmail.com> wrote:
> Please ignore the last patch. Some unwanted debug changes in there!
> Please use this one.
>
> Regards,
> Nikhils
>
> On Wed, May 18, 2011 at 5:28 PM, Nikhil S <nixmisc@gmail.com> wrote:
>>
>> Hi,
>>
>> So, I changed the locale on my setup to "zh_CN.UTF-8" and tried to restore
>> into a database using a backup from earlier. When I click on "Display
>> objects" tab, I see an error being displayed, although the actual restore
>> happens just fine. Note that no error occurs in English locales.
>>
>> Took me a while to figure this one out. The issue is with
>> frmRestore::OnEndProcess() function. It naively avoids lines containing ";"
>> or "P" as the first letter. So in the English locale, the last line about
>> the "Process returned exit code 0" is handled. However in other locales,
>> this will be translated and hence the last line will be inspected leading to
>> a spurious error.
>>
>> The fix is to avoid inspecting the last line. The attached patch does
>> that.
>>
>> Regards,
>> Nikhils
>
>
>
> Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgadmin-hackers
>
>
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company