Errors upgrading from 7.3 to 8.1

Started by Benjamin Smithover 20 years ago5 messagesgeneral
Jump to latest
#1Benjamin Smith
lists@benjamindsmith.com

Currently running Postgres 7.3.9 32bit on Fedora Core 1, and upgrading to PG
8.1 64bit on Centos 4.

When I load the file,
psql -U dbname < dbname.sql

I get this error:
ERROR: invalid UTF-8 byte sequence detected near byte 0x96
when inserting fields that seem to contain HTML. What could be causing this?
My understanding is that pg_dump should properly escape things so that I'm
not trying to dump/load things improperly.

The dumps are made (on the PG 7.3 server)
pg_dump -d -f $OUTPUT.pgsql $db

Are being restore with (on the new 8.1 server)
psql -U $db -e < $OUTPUT.pgsql

-Ben
--
"The best way to predict the future is to invent it."
- XEROX PARC slogan, circa 1978

#2Jim Buttafuoco
jim@contactbda.com
In reply to: Benjamin Smith (#1)
Re: Errors upgrading from 7.3 to 8.1

you should use the 8.1 pg_dump not the 7.3 one.

Give it a try

---------- Original Message -----------
From: Benjamin Smith <lists@benjamindsmith.com>
To: Postgres General <pgsql-general@postgresql.org>
Sent: Mon, 28 Nov 2005 16:22:18 -0800
Subject: [GENERAL] Errors upgrading from 7.3 to 8.1

Currently running Postgres 7.3.9 32bit on Fedora Core 1, and upgrading to PG
8.1 64bit on Centos 4.

When I load the file,
psql -U dbname < dbname.sql

I get this error:
ERROR: invalid UTF-8 byte sequence detected near byte 0x96
when inserting fields that seem to contain HTML. What could be causing this?
My understanding is that pg_dump should properly escape things so that I'm
not trying to dump/load things improperly.

The dumps are made (on the PG 7.3 server)
pg_dump -d -f $OUTPUT.pgsql $db

Are being restore with (on the new 8.1 server)
psql -U $db -e < $OUTPUT.pgsql

-Ben
--
"The best way to predict the future is to invent it."
- XEROX PARC slogan, circa 1978

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

------- End of Original Message -------

#3Stock, Stuart
Stuart.Stock@DrKW.com
In reply to: Jim Buttafuoco (#2)
Re: Errors upgrading from 7.3 to 8.1

FYI in case you still have the problem after using pg_dump from 8.1 (we did)
you may have an encoding mismatch between your 7.3 and 8.1 databases. Our
7.x database was SQL_ASCII while 8.1 defaults to creating databases as
UTF-8. I had similar "invalid UTF-8 byte sequence" errors. I fixed it by
using:

createdb --encoding=SQL_ASCII [your db here]

When creating the database in 8.1. We were then able to load without a
problem.

Not sure you're in the exact same situation, but hope it helps.

Stuart

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Jim Buttafuoco
Sent: Monday, November 28, 2005 4:27 PM
To: lists@benjamindsmith.com; Postgres General
Subject: Re: [GENERAL] Errors upgrading from 7.3 to 8.1

you should use the 8.1 pg_dump not the 7.3 one.

Give it a try

---------- Original Message -----------
From: Benjamin Smith <lists@benjamindsmith.com>
To: Postgres General <pgsql-general@postgresql.org>
Sent: Mon, 28 Nov 2005 16:22:18 -0800
Subject: [GENERAL] Errors upgrading from 7.3 to 8.1

Currently running Postgres 7.3.9 32bit on Fedora Core 1, and upgrading to

PG

8.1 64bit on Centos 4.

When I load the file,
psql -U dbname < dbname.sql

I get this error:
ERROR: invalid UTF-8 byte sequence detected near byte 0x96
when inserting fields that seem to contain HTML. What could be causing

this?

My understanding is that pg_dump should properly escape things so that I'm

not trying to dump/load things improperly.

The dumps are made (on the PG 7.3 server)
pg_dump -d -f $OUTPUT.pgsql $db

Are being restore with (on the new 8.1 server)
psql -U $db -e < $OUTPUT.pgsql

-Ben
--
"The best way to predict the future is to invent it."
- XEROX PARC slogan, circa 1978

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

------- End of Original Message -------

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

If you have received this e-mail in error or wish to read our e-mail disclaimer statement and monitoring policy, please refer to http://www.drkw.com/disc/email/ or contact the sender.

#4Markus Wollny
Markus.Wollny@computec.de
In reply to: Benjamin Smith (#1)
Re: Errors upgrading from 7.3 to 8.1

Hello!

We experienced the exact same problems. You may solve the problem by feeding the dump through iconv. See my earlier message on this issue

http://archives.postgresql.org/pgsql-general/2005-11/msg00799.php

On top of that you'd be well advised to try dumping using pg_dump of postgresql 8.1.

Kind regards

Markus

-----Ursprüngliche Nachricht-----
Von: pgsql-general-owner@postgresql.org im Auftrag von Benjamin Smith
Gesendet: Di 11/29/2005 01:22
An: Postgres General
Betreff: [GENERAL] Errors upgrading from 7.3 to 8.1

Currently running Postgres 7.3.9 32bit on Fedora Core 1, and upgrading to PG
8.1 64bit on Centos 4.

When I load the file,
psql -U dbname < dbname.sql

I get this error:
ERROR: invalid UTF-8 byte sequence detected near byte 0x96
when inserting fields that seem to contain HTML. What could be causing this?
My understanding is that pg_dump should properly escape things so that I'm
not trying to dump/load things improperly.

The dumps are made (on the PG 7.3 server)
pg_dump -d -f $OUTPUT.pgsql $db

Are being restore with (on the new 8.1 server)
psql -U $db -e < $OUTPUT.pgsql

-Ben
--
"The best way to predict the future is to invent it."
- XEROX PARC slogan, circa 1978

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

#5Scott Marlowe
smarlowe@g2switchworks.com
In reply to: Stock, Stuart (#3)
Re: Errors upgrading from 7.3 to 8.1

On Mon, 2005-11-28 at 18:39, Stock, Stuart wrote:

FYI in case you still have the problem after using pg_dump from 8.1 (we did)
you may have an encoding mismatch between your 7.3 and 8.1 databases. Our
7.x database was SQL_ASCII while 8.1 defaults to creating databases as
UTF-8. I had similar "invalid UTF-8 byte sequence" errors. I fixed it by
using:

createdb --encoding=SQL_ASCII [your db here]

When creating the database in 8.1. We were then able to load without a
problem.

Not sure you're in the exact same situation, but hope it helps.

Also, lookup the command iconv. VERY useful. I found out about it from
this list, and use it for plenty other things than just postgresql.