pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Problem restoring a dump
7+ messages / 5 participants
[nested] [flat]

* Problem restoring a dump
@ 2011-09-13 09:18  Johann Spies <jspies@sun.ac.za>
  0 siblings, 1 reply; 7+ messages in thread

From: Johann Spies @ 2011-09-13 09:18 UTC (permalink / raw)
  To: pgsql-admin

Good day,

I have installed postgresql 9.0 on my Debian and thought that restoring
the database would be as simple as psql -f <the dump made by 8.4's
pg_dumpall>.

However: I get several errors like this:

psql:pgdump.txt.1:4453471: ERROR:  character 0xe280a6 of encoding "UTF8"
has no equivalent in "LATIN1"

I have changed the client-encoding of psql to UTF8 but I see after the
restore of the dump the encoding is still LATIN1.

How do I overcome this?

Regards
Johann
-- 
Johann Spies                            Telefoon: 021-808 4699
Databestuurder /  Data manager

Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
Centre for Research on Evaluation, Science and Technology 
Universiteit Stellenbosch.

     "For my thoughts are not your thoughts, neither are 
      your ways my ways, saith the LORD. For as the heavens 
      are higher than the earth, so are my ways higher than 
      your ways, and my thoughts than your thoughts."       
                               Isaiah 55:8,9 



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

* Re: Problem restoring a dump
@ 2011-09-13 09:43  giulio calacoci <giulio.calacoci@2ndquadrant.it>
  parent: Johann Spies <jspies@sun.ac.za>
  0 siblings, 1 reply; 7+ messages in thread

From: giulio calacoci @ 2011-09-13 09:43 UTC (permalink / raw)
  To: Johann Spies <jspies@sun.ac.za>; +Cc: pgsql-admin

hi,

the character that is giving you troubles is "orizontal ellipsis",  this character does not exists in latin1 encoding, only in utf8, so database you dumped was utf8 encoded.

i think the fastest way you have to solve the problem is:  change the encoding of the target database you are trying to restore.

Regards

Giulio.

Il giorno 13/set/2011, alle ore 11.18, Johann Spies ha scritto:

> Good day,
> 
> I have installed postgresql 9.0 on my Debian and thought that restoring
> the database would be as simple as psql -f <the dump made by 8.4's
> pg_dumpall>.
> 
> However: I get several errors like this:
> 
> psql:pgdump.txt.1:4453471: ERROR:  character 0xe280a6 of encoding "UTF8"
> has no equivalent in "LATIN1"
> 
> I have changed the client-encoding of psql to UTF8 but I see after the
> restore of the dump the encoding is still LATIN1.
> 
> How do I overcome this?
> 
> Regards
> Johann
> -- 
> Johann Spies                            Telefoon: 021-808 4699
> Databestuurder /  Data manager
> 
> Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
> Centre for Research on Evaluation, Science and Technology 
> Universiteit Stellenbosch.
> 
>     "For my thoughts are not your thoughts, neither are 
>      your ways my ways, saith the LORD. For as the heavens 
>      are higher than the earth, so are my ways higher than 
>      your ways, and my thoughts than your thoughts."       
>                               Isaiah 55:8,9 
> 
> -- 
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin





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

* Re: Problem restoring a dump
@ 2011-09-13 09:58  Gabriele Bartolini <Gabriele.Bartolini@2ndQuadrant.it>
  parent: giulio calacoci <giulio.calacoci@2ndquadrant.it>
  0 siblings, 1 reply; 7+ messages in thread

From: Gabriele Bartolini @ 2011-09-13 09:58 UTC (permalink / raw)
  To: giulio calacoci <giulio.calacoci@2ndquadrant.it>; +Cc: Johann Spies <jspies@sun.ac.za>; pgsql-admin

 Hi Johann,

    as Giulio pointed out, it seems like the destination database is in 
 LATIN1 encoding, rather than UTF8. Could you please confirm this?

    By reading the little information we have, it seems like you have an 
 export in UTF8 and you are trying to load it into a LATIN1 database. If 
 you specify the client_encoding you are actually informing psql that you 
 are reading UTF8 - which is probably fine given the above assumptions - 
 but that does not specify how the information is then stored in the 
 database. That's decided by the database encoding.

    Also, I suggest that you dump your database using the destination 
 version's pg_dump rather than the source's.

    Please keep us posted.

 Cheers,
 Gabriele

 On Tue, 13 Sep 2011 11:43:27 +0200, giulio calacoci 
 <giulio.calacoci@2ndquadrant.it> wrote:
> hi,
>
> the character that is giving you troubles is "orizontal ellipsis",
> this character does not exists in latin1 encoding, only in utf8, so
> database you dumped was utf8 encoded.
>
> i think the fastest way you have to solve the problem is:  change the
> encoding of the target database you are trying to restore.
>
> Regards
>
> Giulio.
>
> Il giorno 13/set/2011, alle ore 11.18, Johann Spies ha scritto:
>
>> Good day,
>>
>> I have installed postgresql 9.0 on my Debian and thought that 
>> restoring
>> the database would be as simple as psql -f <the dump made by 8.4's
>> pg_dumpall>.
>>
>> However: I get several errors like this:
>>
>> psql:pgdump.txt.1:4453471: ERROR:  character 0xe280a6 of encoding 
>> "UTF8"
>> has no equivalent in "LATIN1"
>>
>> I have changed the client-encoding of psql to UTF8 but I see after 
>> the
>> restore of the dump the encoding is still LATIN1.
>>
>> How do I overcome this?
>>
>> Regards
>> Johann
>> --
>> Johann Spies                            Telefoon: 021-808 4699
>> Databestuurder /  Data manager
>>
>> Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
>> Centre for Research on Evaluation, Science and Technology
>> Universiteit Stellenbosch.
>>
>>     "For my thoughts are not your thoughts, neither are
>>      your ways my ways, saith the LORD. For as the heavens
>>      are higher than the earth, so are my ways higher than
>>      your ways, and my thoughts than your thoughts."
>>                               Isaiah 55:8,9
>>
>> --
>> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-admin

-- 
  Gabriele Bartolini - 2ndQuadrant Italia
  PostgreSQL Training, Services and Support
  Gabriele.Bartolini@2ndQuadrant.it - www.2ndQuadrant.it



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

* Re: Problem restoring a dump
@ 2011-09-13 12:47  Johann Spies <jspies@sun.ac.za>
  parent: Gabriele Bartolini <Gabriele.Bartolini@2ndQuadrant.it>
  0 siblings, 2 replies; 7+ messages in thread

From: Johann Spies @ 2011-09-13 12:47 UTC (permalink / raw)
  To: pgsql-admin

Thanks Giulio and Gabriele,

>     as Giulio pointed out, it seems like the destination database is in 
>  LATIN1 encoding, rather than UTF8. Could you please confirm this?

That was the case.  I deleted one of the databases and recreated it with
as a UTF-8 encoded database and the import went well.

Question:  Can I change the encoding system of an existing database?  If
so, how?

Regards
Johann

-- 
Johann Spies                            Telefoon: 021-808 4699
Databestuurder /  Data manager

Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
Centre for Research on Evaluation, Science and Technology 
Universiteit Stellenbosch.

     "For my thoughts are not your thoughts, neither are 
      your ways my ways, saith the LORD. For as the heavens 
      are higher than the earth, so are my ways higher than 
      your ways, and my thoughts than your thoughts."       
                               Isaiah 55:8,9 



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

* Re: Problem restoring a dump
@ 2011-09-13 20:07  Guillaume Lelarge <guillaume@lelarge.info>
  parent: Johann Spies <jspies@sun.ac.za>
  1 sibling, 0 replies; 7+ messages in thread

From: Guillaume Lelarge @ 2011-09-13 20:07 UTC (permalink / raw)
  To: Johann Spies <jspies@sun.ac.za>; +Cc: pgsql-admin

On Tue, 2011-09-13 at 14:47 +0200, Johann Spies wrote:
> Thanks Giulio and Gabriele,
> 
> >     as Giulio pointed out, it seems like the destination database is in 
> >  LATIN1 encoding, rather than UTF8. Could you please confirm this?
> 
> That was the case.  I deleted one of the databases and recreated it with
> as a UTF-8 encoded database and the import went well.
> 
> Question:  Can I change the encoding system of an existing database?  If
> so, how?
> 

No, you can't. You need to create a new one with the good encoding.


-- 
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com




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

* Re: Problem restoring a dump
@ 2011-09-14 01:56  Craig Ringer <ringerc@ringerc.id.au>
  parent: Johann Spies <jspies@sun.ac.za>
  1 sibling, 1 reply; 7+ messages in thread

From: Craig Ringer @ 2011-09-14 01:56 UTC (permalink / raw)
  To: Johann Spies <jspies@sun.ac.za>; pgsql-admin

On 09/13/2011 08:47 PM, Johann Spies wrote:
> Thanks Giulio and Gabriele,
>
>>      as Giulio pointed out, it seems like the destination database is in
>>   LATIN1 encoding, rather than UTF8. Could you please confirm this?
> That was the case.  I deleted one of the databases and recreated it with
> as a UTF-8 encoded database and the import went well.
>
> Question:  Can I change the encoding system of an existing database?  If
> so, how?
>
You can re-encode a dump (see pg_dump's -E flag) then reload it into a 
new database with the new encoding. This will only work if the source 
database contains only characters that exist in the target encoding.

You can't change the encoding of a database in-place.

--
Craig Ringer

--
Craig Ringer



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

* Re: Problem restoring a dump
@ 2011-09-14 06:35  Johann Spies <jspies@sun.ac.za>
  parent: Craig Ringer <ringerc@ringerc.id.au>
  0 siblings, 0 replies; 7+ messages in thread

From: Johann Spies @ 2011-09-14 06:35 UTC (permalink / raw)
  To: pgsql-admin

On Wed, Sep 14, 2011 at 03:56:27AM +0200, Craig Ringer wrote:

> 
> You can't change the encoding of a database in-place.

Thanks Craig and all the other that responded.

Enjoy your day.

Regards
Johann

-- 
Johann Spies                            Telefoon: 021-808 4699
Databestuurder /  Data manager

Sentrum vir Navorsing oor Evaluasie, Wetenskap en Tegnologie
Centre for Research on Evaluation, Science and Technology 
Universiteit Stellenbosch.

     "But without faith it is impossible to please him: for 
      he that cometh to God must believe that he is, and 
      that he is a rewarder of them that diligently seek 
      him."        Hebrews 11:6 



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


end of thread, other threads:[~2011-09-14 06:35 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-09-13 09:18 Problem restoring a dump Johann Spies <jspies@sun.ac.za>
2011-09-13 09:43 ` giulio calacoci <giulio.calacoci@2ndquadrant.it>
2011-09-13 09:58   ` Gabriele Bartolini <Gabriele.Bartolini@2ndQuadrant.it>
2011-09-13 12:47     ` Johann Spies <jspies@sun.ac.za>
2011-09-13 20:07       ` Guillaume Lelarge <guillaume@lelarge.info>
2011-09-14 01:56       ` Craig Ringer <ringerc@ringerc.id.au>
2011-09-14 06:35         ` Johann Spies <jspies@sun.ac.za>

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