pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
16+ messages / 7 participants
[nested] [flat]

* BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-09-15 23:04  asimantov@tableausoftware.com
  0 siblings, 1 reply; 16+ messages in thread

From: asimantov@tableausoftware.com @ 2014-09-15 23:04 UTC (permalink / raw)
  To: pgsql-bugs

The following bug has been logged on the website:

Bug reference:      11431
Logged by:          Alon Siman-Tov
Email address:      asimantov@tableausoftware.com
PostgreSQL version: 9.3.5
Operating system:   Windows 7 , Windows 2008
Description:        

I am failing to backup/restore a Norwegian-Bokmål database on Windows,
whether the cluster was initialized with English US or Norwegian Bokmål
locale.

The database created within this cluster, has the following locale
settings:
                LC_COLLATE = ''
                LC_CTYPE = ''

I have backed-up the database using the pg_dump command:
                pg_dump.exe -h localhost -p 5432 -U pgadmin -F c -Z 0 -f
"C:/test/bokmaldb.pg_dump" bokmaldb

Then try restoring the pg_dump file using:
                pg_restore.exe -h localhost -p 5432 -U pgadmin -C -d
postgres -j 4 "C:/test/bokmaldb.pg_dump"

Fails with this error:
                pg_restore: [archiver (db)] Error while PROCESSING TOC:
                pg_restore: [archiver (db)] Error from TOC entry 1928; 1262
16384 DATABASE bokmaldb pgadmin
                pg_restore: [archiver (db)] could not execute query: ERROR: 
invalid byte sequence for encoding "UTF8": 0xe5 0x6c 0x29
    Command was: CREATE DATABASE bokmaldb WITH TEMPLATE = template0 ENCODING
= 'UTF8' LC_COLLATE = 'Norwegian (Bokmål)_Norway.1252' LC_CTYPE...

I have tested and failed using the following Windows postgres versions:
                9.3.5
                9.1.14
                9.0.18

Please investigate why Norwegian-Bokmål database cannot be backed-up and
restored.

Set of commands I ran:
                initdb.exe -D  c:/test/pgsql/data -E UTF8
--locale="Norwegian (Bokmål)_Norway.1252" -A trust -U pgadmin
                pg_ctl -D "c:/test/pgsql/data" -l
c:/test/bokmalLocalenblocalePG.log start
                psql.exe -h localhost -p 5432 -d postgres -U pgadmin -c
"CREATE DATABASE bokmaldb;"
                pg_dump.exe -h localhost -p 5432 -U pgadmin -F c -Z 0 -f
"C:/test/bokmaldb.pg_dump" bokmaldb
                psql.exe -h localhost -p 5432 -d postgres -U pgadmin -c
"DROP DATABASE bokmaldb;"
                pg_restore.exe -h localhost -p 5432 -U pgadmin -C -d
postgres -j 4 "C:/test/bokmaldb.pg_dump"

Output of running restore:

                C:\Program Files\PostgreSQL\9.3\bin>pg_restore.exe -h
localhost -p 5432 -U pgadmin -C -d postgres -j 4 "C:/test/bokmaldb.pg_dump
                "
                pg_restore: [archiver (db)] Error while PROCESSING TOC:
                pg_restore: [archiver (db)] Error from TOC entry 1928; 1262
16384 DATABASE bokmaldb pgadmin
                pg_restore: [archiver (db)] could not execute query: ERROR: 
invalid byte sequence for encoding "UTF8": 0xe5 0x6c 0x29
                                Command was: CREATE DATABASE bokmaldb WITH
TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'Norwegian
(Bokmål)_Norway.1252' LC_CTYPE...
                pg_restore: [archiver (db)] could not execute query: ERROR: 
database "bokmaldb" does not exist
                                Command was: ALTER DATABASE bokmaldb OWNER
TO pgadmin;


                pg_restore: [archiver (db)] could not reconnect to database:
FATAL:  database "bokmaldb" does not exist

NOTE: running the following set of commands, that restore database with
Swedish locale works fine:
initdb.exe -D  c:/test/pgsql/data -E UTF8 --locale="Swedish_SWeden.1252" -A
trust -U pgadmin
pg_ctl -D "c:/test/pgsql/data" -l c:/test/swdb.log start
psql.exe -h localhost -p 5432 -d postgres -U pgadmin -c "CREATE DATABASE
swdb;"
pg_dump.exe -h localhost -p 5432 -U pgadmin -F c -Z 0 -f
"C:/test/swdb.pg_dump" swdb
psql.exe -h localhost -p 5432 -d postgres -U pgadmin -c "DROP DATABASE
swdb;"
pg_restore.exe -h localhost -p 5432 -U pgadmin -C -d postgres -j 4
"C:/test/swdb.pg_dump"

** The database is restored with following settings:

CREATE DATABASE swdb
  WITH OWNER = pgadmin
       ENCODING = 'UTF8'
       TABLESPACE = pg_default
       LC_COLLATE = 'Swedish_Sweden.1252'
       LC_CTYPE = 'Swedish_Sweden.1252'
       CONNECTION LIMIT = -1;

 


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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-09-19 22:15  Alon <asimantov@tableausoftware.com>
  parent: asimantov@tableausoftware.com
  0 siblings, 1 reply; 16+ messages in thread

From: Alon @ 2014-09-19 22:15 UTC (permalink / raw)
  To: pgsql-bugs

The pg_dump file contains this command:
CREATE DATABASE workgroup WITH TEMPLATE = template0 ENCODING = 'UTF8'
LC_COLLATE = 'Norwegian (Bokmål)_Norway.1252' LC_CTYPE = 'Norwegian
(Bokmål)_Norway.1252';

The UTF16 encoding for ål) [a-ring l parenthesis] is
00e5 006c 0029

In UTF8 this set of characters encoded as:
c3 a5 6c 29

The a-ring is converted to two bytes while the others are one.  

Based on the ERROR:
invalid byte sequence for encoding "UTF8": 0xe5 0x6c 0x29 

It appears the set of characters is getting passed as:
e5 6c 29

In UTF8, e5 is always the start of a three byte character,possibly
pg_restore, ceratedb or else, tries to read these bytes as a single
character. 
However, 6c and 29 can only be single byte characters, they can't be the
next two bytes in a three byte character.  Hence the failure.
Seems like in the code, the 00xe5 is converted to e5 instead of 'c3 a5' when
passing the LC_COLLATE and LC_CTYPE values.



--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11431-Failing-to-backup-and-restore-a-Windows-postgres-d...
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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-09-21 05:18  Noah Misch <noah@leadboat.com>
  parent: Alon <asimantov@tableausoftware.com>
  0 siblings, 2 replies; 16+ messages in thread

From: Noah Misch @ 2014-09-21 05:18 UTC (permalink / raw)
  To: Alon <asimantov@tableausoftware.com>; +Cc: pgsql-bugs

On Fri, Sep 19, 2014 at 03:15:53PM -0700, Alon wrote:
> The pg_dump file contains this command:
> CREATE DATABASE workgroup WITH TEMPLATE = template0 ENCODING = 'UTF8'
> LC_COLLATE = 'Norwegian (Bokmål)_Norway.1252' LC_CTYPE = 'Norwegian
> (Bokmål)_Norway.1252';
> 
> The UTF16 encoding for ål) [a-ring l parenthesis] is
> 00e5 006c 0029
> 
> In UTF8 this set of characters encoded as:
> c3 a5 6c 29
> 
> The a-ring is converted to two bytes while the others are one.  
> 
> Based on the ERROR:
> invalid byte sequence for encoding "UTF8": 0xe5 0x6c 0x29 
> 
> It appears the set of characters is getting passed as:
> e5 6c 29
> 
> In UTF8, e5 is always the start of a three byte character,possibly
> pg_restore, ceratedb or else, tries to read these bytes as a single
> character. 
> However, 6c and 29 can only be single byte characters, they can't be the
> next two bytes in a three byte character.  Hence the failure.
> Seems like in the code, the 00xe5 is converted to e5 instead of 'c3 a5' when
> passing the LC_COLLATE and LC_CTYPE values.

In WIN1252, "e5 6c 29" is "ål)".  We're likely failing to set client_encoding
at some essential point in the process.


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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-09-21 05:31  John R Pierce <pierce@hogranch.com>
  parent: Noah Misch <noah@leadboat.com>
  1 sibling, 2 replies; 16+ messages in thread

From: John R Pierce @ 2014-09-21 05:31 UTC (permalink / raw)
  To: pgsql-bugs

On 9/20/2014 10:18 PM, Noah Misch wrote:
> On Fri, Sep 19, 2014 at 03:15:53PM -0700, Alon wrote:
>> >The pg_dump file contains this command:
>> >CREATE DATABASE workgroup WITH TEMPLATE = template0 ENCODING = 'UTF8'
>> >LC_COLLATE = 'Norwegian (Bokmål)_Norway.1252' LC_CTYPE = 'Norwegian
>> >(Bokmål)_Norway.1252';...
> In WIN1252, "e5 6c 29" is "ål)".  We're likely failing to set client_encoding
> at some essential point in the process.

is it a problem that ENCODING=utf8 is being used with the collation and 
char typing of Norwegian windows-1252 ?


-- 
john r pierce                                      37N 122W
somewhere on the middle of the left coast



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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re:  Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-09-21 13:37  Alon <asimantov@tableausoftware.com>
  parent: John R Pierce <pierce@hogranch.com>
  1 sibling, 0 replies; 16+ messages in thread

From: Alon @ 2014-09-21 13:37 UTC (permalink / raw)
  To: pgsql-bugs

Yes, the Encoding might be the source of the problem, once initialized the
cluster with WINDOWS1252 as following:

initdb.exe -D  c:/test/pgsql/data -E WINDOWS1252
--locale="Norwegian (Bokmål)_Norway.1252" -A trust -U pgadmin
                pg_ctl -D "c:/test/pgsql/data" -l
c:/test/bokmalLocalenblocalePG.log start 

The cluster created with these settings:
       ENCODING = 'WIN1252'
       TABLESPACE = pg_default
       LC_COLLATE = 'Norwegian (Bokmål)_Norway.1252'
       LC_CTYPE = 'Norwegian (Bokmål)_Norway.1252'

Then pg_backup will create a proper pg_dump file, that can be restored into
database with a Norwegian (Bokmål)_Norway.1252 locale.



--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11431-Failing-to-backup-and-restore-a-Windows-postgres-d...
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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* RE:  Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-09-21 13:38  Alon <asimantov@tableausoftware.com>
  parent: John R Pierce <pierce@hogranch.com>
  1 sibling, 0 replies; 16+ messages in thread

From: Alon @ 2014-09-21 13:38 UTC (permalink / raw)
  To: pgsql-bugs

Yes, the Encoding might be the source of the problem, once initialized the cluster with WINDOWS1252 as following:

initdb.exe -D  c:/test/pgsql/data -E WINDOWS1252
--locale="Norwegian (Bokmål)_Norway.1252" -A trust -U pgadmin
                pg_ctl -D "c:/test/pgsql/data" -l
c:/test/bokmalLocalenblocalePG.log start

The cluster created with these settings:
       ENCODING = 'WIN1252'
       TABLESPACE = pg_default
       LC_COLLATE = 'Norwegian (Bokmål)_Norway.1252'
       LC_CTYPE = 'Norwegian (Bokmål)_Norway.1252'

Then pg_backup will create a proper pg_dump file, that can be restored into database with a Norwegian (Bokmål)_Norway.1252 locale.

Thank you,
Alon

From: John R Pierce [via PostgreSQL] [mailto:ml-node+s1045698n5819819h77@n5.nabble.com]
Sent: Saturday, September 20, 2014 10:32 PM
To: Alon Siman Tov
Subject: Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.

On 9/20/2014 10:18 PM, Noah Misch wrote:
> On Fri, Sep 19, 2014 at 03:15:53PM -0700, Alon wrote:
>> >The pg_dump file contains this command:
>> >CREATE DATABASE workgroup WITH TEMPLATE = template0 ENCODING = 'UTF8'
>> >LC_COLLATE = 'Norwegian (Bokmål)_Norway.1252' LC_CTYPE = 'Norwegian
>> >(Bokmål)_Norway.1252';...
> In WIN1252, "e5 6c 29" is "ål)".  We're likely failing to set client_encoding
> at some essential point in the process.

is it a problem that ENCODING=utf8 is being used with the collation and
char typing of Norwegian windows-1252 ?


--
john r pierce                                      37N 122W
somewhere on the middle of the left coast



--
Sent via pgsql-bugs mailing list ([hidden email]</user/SendEmail.jtp?type=node&node=5819819&i=0>)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs

________________________________
If you reply to this email, your message will be added to the discussion below:
http://postgresql.1045698.n5.nabble.com/BUG-11431-Failing-to-backup-and-restore-a-Windows-postgres-d...
To unsubscribe from BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale., click here<http://postgresql.1045698.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=...;.
NAML<http://postgresql.1045698.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_h...;




--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11431-Failing-to-backup-and-restore-a-Windows-postgres-d...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.

^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-09-21 16:13  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Noah Misch <noah@leadboat.com>
  1 sibling, 1 reply; 16+ messages in thread

From: Tom Lane @ 2014-09-21 16:13 UTC (permalink / raw)
  To: Noah Misch <noah@leadboat.com>; +Cc: Alon <asimantov@tableausoftware.com>; pgsql-bugs

Noah Misch <noah@leadboat.com> writes:
> On Fri, Sep 19, 2014 at 03:15:53PM -0700, Alon wrote:
>> The pg_dump file contains this command:
>> CREATE DATABASE workgroup WITH TEMPLATE = template0 ENCODING = 'UTF8'
>> LC_COLLATE = 'Norwegian (Bokmål)_Norway.1252' LC_CTYPE = 'Norwegian
>> (Bokmål)_Norway.1252';

> In WIN1252, "e5 6c 29" is "ål)".  We're likely failing to set client_encoding
> at some essential point in the process.

The level of stupidity needed to use non-ASCII characters in a locale name
is breathtaking.  What were Microsoft thinking?  How are we supposed to
guess what encoding applies when setting the encoding?

			regards, tom lane


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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-09-21 18:04  Noah Misch <noah@leadboat.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 3 replies; 16+ messages in thread

From: Noah Misch @ 2014-09-21 18:04 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alon <asimantov@tableausoftware.com>; pgsql-bugs

On Sun, Sep 21, 2014 at 12:13:25PM -0400, Tom Lane wrote:
> Noah Misch <noah@leadboat.com> writes:
> > On Fri, Sep 19, 2014 at 03:15:53PM -0700, Alon wrote:
> >> The pg_dump file contains this command:
> >> CREATE DATABASE workgroup WITH TEMPLATE = template0 ENCODING = 'UTF8'
> >> LC_COLLATE = 'Norwegian (Bokmål)_Norway.1252' LC_CTYPE = 'Norwegian
> >> (Bokmål)_Norway.1252';
> 
> > In WIN1252, "e5 6c 29" is "ål)".  We're likely failing to set client_encoding
> > at some essential point in the process.
> 
> The level of stupidity needed to use non-ASCII characters in a locale name
> is breathtaking.  What were Microsoft thinking?

Windows Vista did deprecate that locale name style in favor of "nb-NO".
setlocale(LC_x, "") still returns the old style, though.  You need PostgreSQL
built with VS2012 or later to use "nb-NO" style; see IsoLocaleName().

> How are we supposed to
> guess what encoding applies when setting the encoding?

Windows functions with "char *" arguments where encoding matters typically
expect the argument to be in the Windows ANSI code page.


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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: [BUGS] Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-09-22 16:38  Heikki Linnakangas <hlinnakangas@vmware.com>
  parent: Noah Misch <noah@leadboat.com>
  2 siblings, 0 replies; 16+ messages in thread

From: Heikki Linnakangas @ 2014-09-22 16:38 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Noah Misch <noah@leadboat.com>; Alon <asimantov@tableausoftware.com>; pgsql-bugs

On 09/22/2014 07:10 PM, Tom Lane wrote:
> Heikki Linnakangas <hlinnakangas@vmware.com> writes:
>> I think we should map "Norwegian (Bokmål)" to "norwegian-bokmal", so
>> that the mapping is applied to the return value of setlocale(). So when
>> initdb does setlocale(NULL, "") to get the locale, we'll return
>> "norwegian-bokmal", and that gets stored in the catalogs and
>> postgresql.conf.
>
> That seems like a reasonable hack if there's only the one case ...
> how sure are we about that?

That's the only one I can see in MSDN documentation, and in the dropdown 
box in Windows 7. New languages and countries pop up every now and then, 
but overall the lists are fairly stable. And we could live with a few of 
these if we have to.

- Heikki



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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re:  Re: [BUGS] Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-10-10 18:32  Alon <asimantov@tableausoftware.com>
  parent: Noah Misch <noah@leadboat.com>
  2 siblings, 1 reply; 16+ messages in thread

From: Alon @ 2014-10-10 18:32 UTC (permalink / raw)
  To: pgsql-bugs

Looks like great progress has been made to address this issue. Any idea which
release the patch might go in?
 



--
View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11431-Failing-to-backup-and-restore-a-Windows-postgres-d...
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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

*  Re: [BUGS] Re: [BUGS] Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-10-11 12:57  Michael Paquier <michael.paquier@gmail.com>
  parent: Alon <asimantov@tableausoftware.com>
  0 siblings, 0 replies; 16+ messages in thread

From: Michael Paquier @ 2014-10-11 12:57 UTC (permalink / raw)
  To: Alon <asimantov@tableausoftware.com>; +Cc: pgsql-bugs

On Sat, Oct 11, 2014 at 3:32 AM, Alon <asimantov@tableausoftware.com> wrote:
> Looks like great progress has been made to address this issue. Any idea which
> release the patch might go in?
I imagine that it will be in for 9.3.6, the next minor release of hte
9.3 series.
Regards,
-- 
Michael


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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: [BUGS] Re: [BUGS] Re: [BUGS] Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-10-24 18:15  Heikki Linnakangas <hlinnakangas@vmware.com>
  parent: Noah Misch <noah@leadboat.com>
  2 siblings, 1 reply; 16+ messages in thread

From: Heikki Linnakangas @ 2014-10-24 18:15 UTC (permalink / raw)
  To: Noah Misch <noah@leadboat.com>; Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Alon <asimantov@tableausoftware.com>; pgsql-bugs; Bruce Momjian <bruce@momjian.us>

On 10/10/2014 03:45 PM, Heikki Linnakangas wrote:
> On 09/25/2014 03:22 PM, Heikki Linnakangas wrote:
>> Alternatively, we could not bother with changing pg_upgrade or CREATE
>> DATABASE, and instead instruct Bokmål users to do the manual UPDATE of
>> pg_database in the release notes. That might be the most robust
>> solution, if there are more cases where we compare locales that I've missed.
>
> I just realized that pg_upgrade doesn't currently do the
> canonicalization when upgrading from a pre-8.4 server. So AFAICS,
> upgrading from 8.3 to 9.2-9.4 will fail, if the locale name in the old
> cluster doesn't happen to match the canonical form.
>
> I committed the pg_upgrade patch discussed on the other thread to
> master. For the 9.2->9.4 back-branches, I think we should do the
> attached
> (0001-Make-the-locale-comparison-in-pg_upgrade-more-lenien.patch). This
> fixes the problem with 8.3 -> 9.2 upgrades, and prepares pg_upgrade for
> the "Norwegian (Bokmål)" -> "norwegian-bokmal" mapping.
>
>
> Now, for the mapping. I thought about it some more, and I think we
> really need to provide instructions to fix existing clusters, as part of
> the release notes. Even if we do the change to CREATE DATABASE that I
> included in my earlier patch, you'll continue to have problems with
> different encodings. And initdb writes the values in postgresql.conf
> too, for lc_messages et all. Those really should be fixed too.
>
> So I don't think there's much point in the CREATE DATABASE part. Let's
> backpatch the attached patch
> (0001-Work-around-Windows-locale-name-with-non-ASCII-chara.patch) and
> add the attached instructions to the release notes.
>
> The UPDATE statements in the instructions are specially crafted to avoid
> "invalid byte sequence" errors, if they're run from a database that uses
> a different encoding than the one used in the existing rows. I tried
> using regexp_replace at first, but tries to decode all the characters,
> and fails. I'm not 100% this would work with every encoding, but at
> least it works with a mixture of LATIN1 and UTF-8, which are the most
> likely encodings to be used with Norwegian.
>
> These three things together, the pg_upgrade patch, the setlocale()
> mapping patch and the release note changes, resolves the issue.

Ok, I've committed these patches now.

The release note entry needs to be written, with the instructions on 
updating pg_database. We don't have anywhere to stash release note 
entries for minor releases, until we actually write the release notes, 
do we?

- Heikki


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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re: [BUGS] Re: [BUGS] Re: [BUGS] Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2014-10-24 18:52  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Heikki Linnakangas <hlinnakangas@vmware.com>
  0 siblings, 1 reply; 16+ messages in thread

From: Tom Lane @ 2014-10-24 18:52 UTC (permalink / raw)
  To: Heikki Linnakangas <hlinnakangas@vmware.com>; +Cc: Noah Misch <noah@leadboat.com>; Alon <asimantov@tableausoftware.com>; pgsql-bugs; Bruce Momjian <bruce@momjian.us>

Heikki Linnakangas <hlinnakangas@vmware.com> writes:
> The release note entry needs to be written, with the instructions on 
> updating pg_database. We don't have anywhere to stash release note 
> entries for minor releases, until we actually write the release notes, 
> do we?

The normal procedure is that you put sufficient information into the
commit message for the release notes to be written from that.  If you
didn't, tut tut ... but you could add an SGML comment at the front of
release-9.4.sgml where the next section will get added.

			regards, tom lane


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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re:  Re: [BUGS] Re: [BUGS] Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2015-05-08 21:05  Alon <asimantov@tableausoftware.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 16+ messages in thread

From: Alon @ 2015-05-08 21:05 UTC (permalink / raw)
  To: pgsql-bugs

Any time estimate in which release/revision the fix might be? 



--
View this message in context: http://postgresql.nabble.com/BUG-11431-Failing-to-backup-and-restore-a-Windows-postgres-database-wit...
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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re:  Re: [BUGS] Re: [BUGS] Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database,  with Norwegian Bokmål locale.
@ 2015-05-08 21:09  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Alon <asimantov@tableausoftware.com>
  0 siblings, 1 reply; 16+ messages in thread

From: Tom Lane @ 2015-05-08 21:09 UTC (permalink / raw)
  To: Alon <asimantov@tableausoftware.com>; +Cc: pgsql-bugs

Alon <asimantov@tableausoftware.com> writes:
> Any time estimate in which release/revision the fix might be? 

The last ones, no?  Or are you claiming this was not fixed in 9.4.1 et al?

http://www.postgresql.org/docs/9.4/static/release-9-4-1.html

			regards, tom lane


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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread

* Re: Re:  Re: [BUGS] Re: [BUGS] Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale.
@ 2015-05-08 21:21  Alon <asimantov@tableausoftware.com>
  parent: Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 16+ messages in thread

From: Alon @ 2015-05-08 21:21 UTC (permalink / raw)
  To: pgsql-bugs

"The 9.4.1, 9.3.6, and 9.2.10 minor releases contain changes to the way
Postgres handles the Norwegian (Bokmål) locale on Windows. "

So based on the link, 9.3.6 should contain the fix. Right?
If so, I will test it and inform.



--
View this message in context: http://postgresql.nabble.com/BUG-11431-Failing-to-backup-and-restore-a-Windows-postgres-database-wit...
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



^ permalink  raw  reply  [nested|flat] 16+ messages in thread


end of thread, other threads:[~2015-05-08 21:21 UTC | newest]

Thread overview: 16+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-09-15 23:04 BUG #11431: Failing to backup and restore a Windows postgres database, with Norwegian Bokmål locale. asimantov@tableausoftware.com
2014-09-19 22:15 ` Alon <asimantov@tableausoftware.com>
2014-09-21 05:18   ` Noah Misch <noah@leadboat.com>
2014-09-21 05:31     ` John R Pierce <pierce@hogranch.com>
2014-09-21 13:37       ` Alon <asimantov@tableausoftware.com>
2014-09-21 13:38       ` Alon <asimantov@tableausoftware.com>
2014-09-21 16:13     ` Tom Lane <tgl@sss.pgh.pa.us>
2014-09-21 18:04       ` Noah Misch <noah@leadboat.com>
2014-09-22 16:38         ` Heikki Linnakangas <hlinnakangas@vmware.com>
2014-10-10 18:32         ` Alon <asimantov@tableausoftware.com>
2014-10-11 12:57           ` Michael Paquier <michael.paquier@gmail.com>
2014-10-24 18:15         ` Heikki Linnakangas <hlinnakangas@vmware.com>
2014-10-24 18:52           ` Tom Lane <tgl@sss.pgh.pa.us>
2015-05-08 21:05             ` Alon <asimantov@tableausoftware.com>
2015-05-08 21:09               ` Re: Re:  Re: [BUGS] Re: [BUGS] Re: [BUGS] Re: BUG #11431: Failing to backup and restore a Windows postgres database,  with Norwegian Bokmål locale. Tom Lane <tgl@sss.pgh.pa.us>
2015-05-08 21:21                 ` Alon <asimantov@tableausoftware.com>

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