Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XTzrn-0002E6-B7 for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Sep 2014 21:00:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XTzrm-0002O5-JM for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Sep 2014 21:00:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XTfKW-0006tC-9R for pgsql-bugs@postgresql.org; Mon, 15 Sep 2014 23:05:08 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XTfKR-0005mZ-B7 for pgsql-bugs@postgresql.org; Mon, 15 Sep 2014 23:05:06 +0000 MIME-Version: 1.0 Subject: =?utf-8?q?BUG_=2311431=3A_Failing_to_backup_and_restore_a_Windows_?= =?utf-8?q?postgres_database=2C_with_Norwegian_Bokm=C3=A5l_locale=2E?= To: pgsql-bugs@postgresql.org From: asimantov@tableausoftware.com Date: Mon, 15 Sep 2014 23:04:27 +0000 Message-ID: <20140915230427.2486.29437@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.2 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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