(Might be a bug) locale issue while upgrading data directory from PostgreSQL 8.4 to 9.5

Started by Mayank Agrawalalmost 9 years ago5 messagesgeneral
Jump to latest
#1Mayank Agrawal
mayankagr009@gmail.com

Hello,

I am upgrading PostgreSQL 8.4 to 9.5 on Windows. There is some issue
related to locale. Details are as follows:

The steps that I am following are:

1. Install PostgreSQL 9.5 (8.4 is already installed).

2. Migrate data from 8.4's data dir to 9.5's data dir using pg_upgrade
utility.

3. After successful upgrade, uninstall PostgreSQL 8.4

Here the issue is that PostgreSQL 8.4 could be installed with any locale
(English or French etc.) and to have successful data directory upgrade,
PostgreSQL 9.5 must be installed with the same locale as that of 8.4.

Supplying the output of query 'Show lc_collate' (executed on PostgreSQL
8.4) to PostgreSQL 9.5 installation leads to failed installation. It
generates the error 'specified locale is not supported'.

Here is the example:

Output (PostgreSQL 8.4) of query 'SHOW LC_COLLATE': English_United
States.1252

A. --locale "English_United States.1252"

While installing PostgreSQL 9.5, If we pass locale option as above,
installer aborts with an error 'specified locale is not supported'.

B. --locale "English, United States"

If we pass locale option as above, installation is successful and cluster
locale is set to 'English, United States'.

*Given that one has access to PostgreSQL 8.4, how would one know what value
to pass to the parameter --locale while installing PostgreSQL 9.5?*

Thanks and Regards,

Mayank Agrawal

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Mayank Agrawal (#1)
Re: (Might be a bug) locale issue while upgrading data directory from PostgreSQL 8.4 to 9.5

On 07/04/2017 10:23 PM, Mayank Agrawal wrote:

Hello,

I am upgrading PostgreSQL 8.4 to 9.5 on Windows. There is some issue
related to locale. Details are as follows:

The steps that I am following are:

1. Install PostgreSQL 9.5 (8.4 is already installed).

2. Migrate data from 8.4's data dir to 9.5's data dir using pg_upgrade
utility.

3. After successful upgrade, uninstall PostgreSQL 8.4

Here the issue is that PostgreSQL 8.4 could be installed with any locale
(English or French etc.) and to have successful data directory upgrade,
PostgreSQL 9.5 must be installed with the same locale as that of 8.4.

Supplying the output of query 'Show lc_collate' (executed on PostgreSQL
8.4) to PostgreSQL 9.5 installation leads to failed installation. It
generates the error 'specified locale is not supported'.

Has the Windows version been upgraded between the install of 8.4 and the
upgrade to 9.5?

Here is the example:

Output (PostgreSQL 8.4) of query 'SHOW LC_COLLATE': English_United
States.1252

A. --locale "English_United States.1252"

While installing PostgreSQL 9.5, If we pass locale option as above,
installer aborts with an error 'specified locale is not supported'.

B. --locale "English, United States"

If we pass locale option as above, installation is successful and
cluster locale is set to 'English, United States'.

*Given that one has access to PostgreSQL 8.4, how would one know what
value to pass to the parameter --locale while installing PostgreSQL 9.5?*

Thanks and Regards,

Mayank Agrawal

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#3Mayank Agrawal
mayankagr009@gmail.com
In reply to: Adrian Klaver (#2)
Re: (Might be a bug) locale issue while upgrading data directory from PostgreSQL 8.4 to 9.5

No, windows has not been upgraded (Windows 7). Moreover, I think it is not
related to windows version, because I tried the scenarios from scratch on a
same machine and on a some windows version.

While working on this issue I notices something. Details are as follows:

On Windows7, I installed the PostgreSQL 8.4 with following *--locale* values

1.

*--locale "English_United States.1252"*

Installation fails, gives same error: 'Locale specified is not
supported.'
2.

*--locale "English, United States"*

Successful Installation, value of '*Show lc_collate*': *English, United
States*
3.

No Value (i.e. parameter *--locale* is not provided during installation)

Successful Installation, value of '*Show lc_collate*': *English_United
States.1252*

If you notice point 1. and 3., locale value can be stored as *English_United
States.1252* but can not be given as a value of parameter *--locale* during
installation. This seems to me as a bug.

In my case, *--locale* parameter was not provided during PostgreSQL 8.4
installation [scenario 3].
Thanks and Regards,
Mayank Agrawal

.

On Fri, Jul 7, 2017 at 4:56 AM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

Show quoted text

On 07/04/2017 10:23 PM, Mayank Agrawal wrote:

Hello,

I am upgrading PostgreSQL 8.4 to 9.5 on Windows. There is some issue
related to locale. Details are as follows:

The steps that I am following are:

1. Install PostgreSQL 9.5 (8.4 is already installed).

2. Migrate data from 8.4's data dir to 9.5's data dir using pg_upgrade
utility.

3. After successful upgrade, uninstall PostgreSQL 8.4

Here the issue is that PostgreSQL 8.4 could be installed with any locale
(English or French etc.) and to have successful data directory upgrade,
PostgreSQL 9.5 must be installed with the same locale as that of 8.4.

Supplying the output of query 'Show lc_collate' (executed on PostgreSQL
8.4) to PostgreSQL 9.5 installation leads to failed installation. It
generates the error 'specified locale is not supported'.

Has the Windows version been upgraded between the install of 8.4 and the
upgrade to 9.5?

Here is the example:

Output (PostgreSQL 8.4) of query 'SHOW LC_COLLATE': English_United
States.1252

A. --locale "English_United States.1252"

While installing PostgreSQL 9.5, If we pass locale option as above,
installer aborts with an error 'specified locale is not supported'.

B. --locale "English, United States"

If we pass locale option as above, installation is successful and cluster
locale is set to 'English, United States'.

*Given that one has access to PostgreSQL 8.4, how would one know what
value to pass to the parameter --locale while installing PostgreSQL 9.5?*

Thanks and Regards,

Mayank Agrawal

--
Adrian Klaver
adrian.klaver@aklaver.com

#4Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Mayank Agrawal (#3)
Re: (Might be a bug) locale issue while upgrading data directory from PostgreSQL 8.4 to 9.5

On 07/06/2017 11:13 PM, Mayank Agrawal wrote:

No, windows has not been upgraded (Windows 7). Moreover, I think it is
not related to windows version, because I tried the scenarios from
scratch on a same machine and on a some windows version.

While working on this issue I notices something. Details are as follows:

On Windows7, I installed the PostgreSQL 8.4 with following /--locale/ values

1.

/--locale "English_United States.1252"/

Installation fails, gives same error: 'Locale specified is not
supported.'

2.

/--locale "English, United States"/

Successful Installation, value of '/Show lc_collate/': /English,
United States/

3.

No Value (i.e. parameter /--locale/ is not provided during installation)

Successful Installation, value of '/Show lc_collate/':
/English_United States.1252/

If you notice point 1. and 3., locale value can be stored as
/English_United States.1252/ but can not be given as a value of
parameter /--locale/ during installation. This seems to me as a bug.

The answer would seem to be here(~/src/port>chklocale.c):

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/port/chklocale.c;h=7a3e3af74d1554b706bef10886dc32ace61361ed;hb=aa3bcba08d466bc6fd2558f8f0bf0e6d6c89b58b

around line 195-300.

The behavior looks to be compiler version dependent.

That leads to another question, where did you get Postgres for 8.4 and 9.5?

In my case, /--locale/ parameter was not provided during PostgreSQL 8.4
installation [scenario 3].

Thanks and Regards,
Mayank Agrawal

.

On Fri, Jul 7, 2017 at 4:56 AM, Adrian Klaver <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>> wrote:

On 07/04/2017 10:23 PM, Mayank Agrawal wrote:

Hello,

I am upgrading PostgreSQL 8.4 to 9.5 on Windows. There is some
issue related to locale. Details are as follows:

The steps that I am following are:

1. Install PostgreSQL 9.5 (8.4 is already installed).

2. Migrate data from 8.4's data dir to 9.5's data dir using
pg_upgrade utility.

3. After successful upgrade, uninstall PostgreSQL 8.4

Here the issue is that PostgreSQL 8.4 could be installed with
any locale (English or French etc.) and to have successful data
directory upgrade, PostgreSQL 9.5 must be installed with the
same locale as that of 8.4.

Supplying the output of query 'Show lc_collate' (executed on
PostgreSQL 8.4) to PostgreSQL 9.5 installation leads to failed
installation. It generates the error 'specified locale is not
supported'.

Has the Windows version been upgraded between the install of 8.4 and
the upgrade to 9.5?

Here is the example:

Output (PostgreSQL 8.4) of query 'SHOW LC_COLLATE':
English_United States.1252

A. --locale "English_United States.1252"

While installing PostgreSQL 9.5, If we pass locale option as
above, installer aborts with an error 'specified locale is not
supported'.

B. --locale "English, United States"

If we pass locale option as above, installation is successful
and cluster locale is set to 'English, United States'.

*Given that one has access to PostgreSQL 8.4, how would one know
what value to pass to the parameter --locale while installing
PostgreSQL 9.5?*

Thanks and Regards,

Mayank Agrawal

--
Adrian Klaver
adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>

--
Adrian Klaver
adrian.klaver@aklaver.com

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#5Mayank Agrawal
mayankagr009@gmail.com
In reply to: Adrian Klaver (#4)
Re: (Might be a bug) locale issue while upgrading data directory from PostgreSQL 8.4 to 9.5

The setups were downloaded from postgresql site only.

On Jul 7, 2017 7:12 PM, "Adrian Klaver" <adrian.klaver@aklaver.com> wrote:

On 07/06/2017 11:13 PM, Mayank Agrawal wrote:

No, windows has not been upgraded (Windows 7). Moreover, I think it is not
related to windows version, because I tried the scenarios from scratch on a
same machine and on a some windows version.

While working on this issue I notices something. Details are as follows:

On Windows7, I installed the PostgreSQL 8.4 with following /--locale/
values

1.

/--locale "English_United States.1252"/

Installation fails, gives same error: 'Locale specified is not
supported.'

2.

/--locale "English, United States"/

Successful Installation, value of '/Show lc_collate/': /English,
United States/

3.

No Value (i.e. parameter /--locale/ is not provided during
installation)

Successful Installation, value of '/Show lc_collate/':
/English_United States.1252/

If you notice point 1. and 3., locale value can be stored as
/English_United States.1252/ but can not be given as a value of parameter
/--locale/ during installation. This seems to me as a bug.

The answer would seem to be here(~/src/port>chklocale.c):

https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f
=src/port/chklocale.c;h=7a3e3af74d1554b706bef10886dc32ace613
61ed;hb=aa3bcba08d466bc6fd2558f8f0bf0e6d6c89b58b

around line 195-300.

The behavior looks to be compiler version dependent.

That leads to another question, where did you get Postgres for 8.4 and 9.5?

In my case, /--locale/ parameter was not provided during PostgreSQL 8.4
installation [scenario 3].

Thanks and Regards,
Mayank Agrawal

.

On Fri, Jul 7, 2017 at 4:56 AM, Adrian Klaver <adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>> wrote:

On 07/04/2017 10:23 PM, Mayank Agrawal wrote:

Hello,

I am upgrading PostgreSQL 8.4 to 9.5 on Windows. There is some
issue related to locale. Details are as follows:

The steps that I am following are:

1. Install PostgreSQL 9.5 (8.4 is already installed).

2. Migrate data from 8.4's data dir to 9.5's data dir using
pg_upgrade utility.

3. After successful upgrade, uninstall PostgreSQL 8.4

Here the issue is that PostgreSQL 8.4 could be installed with
any locale (English or French etc.) and to have successful data
directory upgrade, PostgreSQL 9.5 must be installed with the
same locale as that of 8.4.

Supplying the output of query 'Show lc_collate' (executed on
PostgreSQL 8.4) to PostgreSQL 9.5 installation leads to failed
installation. It generates the error 'specified locale is not
supported'.

Has the Windows version been upgraded between the install of 8.4 and
the upgrade to 9.5?

Here is the example:

Output (PostgreSQL 8.4) of query 'SHOW LC_COLLATE':
English_United States.1252

A. --locale "English_United States.1252"

While installing PostgreSQL 9.5, If we pass locale option as
above, installer aborts with an error 'specified locale is not
supported'.

B. --locale "English, United States"

If we pass locale option as above, installation is successful
and cluster locale is set to 'English, United States'.

*Given that one has access to PostgreSQL 8.4, how would one know
what value to pass to the parameter --locale while installing
PostgreSQL 9.5?*

Thanks and Regards,

Mayank Agrawal

-- Adrian Klaver
adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>

--
Adrian Klaver
adrian.klaver@aklaver.com