pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Migrating from 7.1 to 7.2 using pg_dump/pg_restore fails - UNICODE error
5+ messages / 2 participants
[nested] [flat]

* Migrating from 7.1 to 7.2 using pg_dump/pg_restore fails - UNICODE error
@ 2003-07-06 17:57  Soeren Laursen <sl@scrooge.dk>
  0 siblings, 2 replies; 5+ messages in thread

From: Soeren Laursen @ 2003-07-06 17:57 UTC (permalink / raw)
  To: pgsql-admin

Hi All,

I am upgrading my server 7.1 (a debian potato) to a new server 7.2 (a
debian woody).

On the 7.1 server I had a script that took a backup of my databases
each day using pg_dump:

/usr/local/pgsql/bin/vacuumdb -z -h localhost -U postgres $i
>/dev/null 2>&1
/usr/local/pgsql/bin/pg_dump -b -Fc -Z9 $i -h 127.0.0.1 >
"$backup_dir/$katalog/$mappe/postgresql-$i-$timeslot-database.db"

I can restore the *.db files without any problems on the 7.1. But
when I move the *.db files to the 7.2 I get the following error:

pg_restore: ERROR:  copy: line 1, Invalid UNICODE character sequence
found (0xf87665)

It is the same even if I use INSERT instead of COPY. I have no clue
that went wrong?

During a search on the internet I have seen some suggestions where I
can change the *.db file to include an
\encoding UNICODE command but this fails because I use the customer
format I guess.

No need to say that the new database is created with UNICODE
encoding?!

Regards,

Søren Laursen




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

* Re: Migrating from 7.1 to 7.2 using pg_dump/pg_restore
@ 2003-07-06 21:13  Markus Bertheau <twanger@bluetwanger.de>
  parent: Soeren Laursen <sl@scrooge.dk>
  1 sibling, 0 replies; 5+ messages in thread

From: Markus Bertheau @ 2003-07-06 21:13 UTC (permalink / raw)
  To: soeren.laursen@scrooge.dk; +Cc: pgsql-admin

В Вск, 06.07.2003, в 19:57, Soeren Laursen пишет:

> pg_restore: ERROR:  copy: line 1, Invalid UNICODE character sequence
> found (0xf87665)

> No need to say that the new database is created with UNICODE
> encoding?!

use

\encoding latin1

once when you import the data. That'll convert the data from latin1 to
utf-8 encoded unicode on the fly. Then again I don't know what charset
denmark uses usually, probably some other latin variant.

-- 
Markus Bertheau.
Berlin, Berlin.
Germany.



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

* Re: Migrating from 7.1 to 7.2 using pg_dump/pg_restore fails - UNICODE error
@ 2003-07-06 22:01  Soeren Laursen <sl@scrooge.dk>
  parent: Soeren Laursen <sl@scrooge.dk>
  1 sibling, 2 replies; 5+ messages in thread

From: Soeren Laursen @ 2003-07-06 22:01 UTC (permalink / raw)
  To: Markus Bertheau <twanger@bluetwanger.de>; +Cc: pgsql-admin

Hi,

I am not sure how and where I should use the \encoding latin1

Something like,

psql test01
\encodinng latin1
\q

pg_restore .....

Regards

Søren,

> В Вск, 06.07.2003, в 19:57, Soeren Laursen пишет:
>
> > pg_restore: ERROR:  copy: line 1, Invalid UNICODE character sequence
> > found (0xf87665)
>
> > No need to say that the new database is created with UNICODE
> > encoding?!
>
> use
>
> \encoding latin1
>
> once when you import the data. That'll convert the data from latin1 to
> utf-8 encoded unicode on the fly. Then again I don't know what charset
> denmark uses usually, probably some other latin variant.
>
> --
> Markus Bertheau.
> Berlin, Berlin.
> Germany.





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

* Re: Migrating from 7.1 to 7.2 using pg_dump/pg_restore
@ 2003-07-06 22:48  Markus Bertheau <twanger@bluetwanger.de>
  parent: Soeren Laursen <sl@scrooge.dk>
  1 sibling, 0 replies; 5+ messages in thread

From: Markus Bertheau @ 2003-07-06 22:48 UTC (permalink / raw)
  To: soeren.laursen@scrooge.dk; +Cc: pgsql-admin

В Пнд, 07.07.2003, в 00:01, Soeren Laursen пишет:
> Hi,
> 
> I am not sure how and where I should use the \encoding latin1
> 
> Something like,
> 
> psql test01 
> \encodinng latin1
> \q
> 
> pg_restore .....

Ah. Load the backup in a non-unicode database, dump it using the text
format (i.e. not the custom format), put the encoding thing in front of
the file and load it into your unicode database.

-- 
Markus Bertheau.
Berlin, Berlin.
Germany.



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

* Re: Migrating from 7.1 to 7.2 using pg_dump/pg_restore	fails - UNICODE error
@ 2003-07-07 08:12  Soeren Laursen <sl@scrooge.dk>
  parent: Soeren Laursen <sl@scrooge.dk>
  1 sibling, 0 replies; 5+ messages in thread

From: Soeren Laursen @ 2003-07-07 08:12 UTC (permalink / raw)
  To: Markus Bertheau <twanger@bluetwanger.de>; +Cc: pgsql-admin

It looked like that worked,

How about large objects (blobs). That is the reason I use custom
format or am I missing a point here?

I guess I might could use a lot of switches and only dump the
blobs in a single file?

Regards,

Søren,
> В Пнд, 07.07.2003, в 00:01, Soeren Laursen пишет:
> > Hi,
> >
> > I am not sure how and where I should use the \encoding latin1
> >
> > Something like,
> >
> > psql test01
> > \encodinng latin1
> > \q
> >
> > pg_restore .....
>
> Ah. Load the backup in a non-unicode database, dump it using the text
> format (i.e. not the custom format), put the encoding thing in front of
> the file and load it into your unicode database.
>
> --
> Markus Bertheau.
> Berlin, Berlin.
> Germany.





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


end of thread, other threads:[~2003-07-07 08:12 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-07-06 17:57 Migrating from 7.1 to 7.2 using pg_dump/pg_restore fails - UNICODE error Soeren Laursen <sl@scrooge.dk>
2003-07-06 21:13 ` Re: Migrating from 7.1 to 7.2 using pg_dump/pg_restore Markus Bertheau <twanger@bluetwanger.de>
2003-07-06 22:01 ` Soeren Laursen <sl@scrooge.dk>
2003-07-06 22:48   ` Re: Migrating from 7.1 to 7.2 using pg_dump/pg_restore Markus Bertheau <twanger@bluetwanger.de>
2003-07-07 08:12   ` Re: Migrating from 7.1 to 7.2 using pg_dump/pg_restore	fails - UNICODE error Soeren Laursen <sl@scrooge.dk>

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