pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Changing encoding
6+ messages / 4 participants
[nested] [flat]

* Changing encoding
@ 2008-07-15 14:14 Carol Walter <walterc@indiana.edu>
  2008-07-15 15:04 ` Re: Changing encoding Peter Eisentraut <peter_e@gmx.net>
  2008-07-15 17:26 ` Re: Changing encoding Ivo Rossacher <rossacher@bluewin.ch>
  0 siblings, 2 replies; 6+ messages in thread

From: Carol Walter @ 2008-07-15 14:14 UTC (permalink / raw)
  To: pgsql-admin

Hello,

I have some databases that use SQL ASCII or Latin1 encoding that need  
to be UTF8.  When I have drop the database and recreated it with the  
correct encoding I get errors in restoring the data.  How is this done?

Carol



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

* Re: Changing encoding
  2008-07-15 14:14 Changing encoding Carol Walter <walterc@indiana.edu>
@ 2008-07-15 15:04 ` Peter Eisentraut <peter_e@gmx.net>
  2008-07-15 15:58   ` Re: Changing encoding Carol Walter <walterc@indiana.edu>
  1 sibling, 1 reply; 6+ messages in thread

From: Peter Eisentraut @ 2008-07-15 15:04 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Carol Walter <walterc@indiana.edu>

Am Dienstag, 15. Juli 2008 schrieb Carol Walter:
> I have some databases that use SQL ASCII or Latin1 encoding that need
> to be UTF8.  When I have drop the database and recreated it with the
> correct encoding I get errors in restoring the data.  How is this done?

What is your PostgreSQL version?  What is the exact command sequence?

The sort of problem you describe is usually fixed by setting the client 
encoding correctly, but recent versions should do this automatically for 
dumps/restores.



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

* Re: Changing encoding
  2008-07-15 14:14 Changing encoding Carol Walter <walterc@indiana.edu>
  2008-07-15 15:04 ` Re: Changing encoding Peter Eisentraut <peter_e@gmx.net>
@ 2008-07-15 15:58   ` Carol Walter <walterc@indiana.edu>
  0 siblings, 0 replies; 6+ messages in thread

From: Carol Walter @ 2008-07-15 15:58 UTC (permalink / raw)
  To: Peter Eisentraut <peter_e@gmx.net>; +Cc: pgsql-admin

I'm at 8.2.3
I do a data only pg_dump. I drop the database, then recreate it with  
the correct encoding.  Then load the data back in with psql.

Carol

On Jul 15, 2008, at 11:04 AM, Peter Eisentraut wrote:

> Am Dienstag, 15. Juli 2008 schrieb Carol Walter:
>> I have some databases that use SQL ASCII or Latin1 encoding that need
>> to be UTF8.  When I have drop the database and recreated it with the
>> correct encoding I get errors in restoring the data.  How is this  
>> done?
>
> What is your PostgreSQL version?  What is the exact command sequence?
>
> The sort of problem you describe is usually fixed by setting the  
> client
> encoding correctly, but recent versions should do this  
> automatically for
> dumps/restores.




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

* Re: Changing encoding
  2008-07-15 14:14 Changing encoding Carol Walter <walterc@indiana.edu>
@ 2008-07-15 17:26 ` Ivo Rossacher <rossacher@bluewin.ch>
  1 sibling, 0 replies; 6+ messages in thread

From: Ivo Rossacher @ 2008-07-15 17:26 UTC (permalink / raw)
  To: pgsql-admin

For the SQL_ASCII tables it depends what was actually written to the tables. 
SQL_ASCII means that the server does not do any conversation and that the 
client is responsible for the used encoding. So if there is data in the table 
with different encodings (comming from different clients with different 
encodings) you need to fix this by hand (depending on the data size an 
editor, iconv, recode or similar might help you with this).
The Latin1 tables might be fixed by iconv or be autodetected by the server.

You can find details about the subject in the chapter 21.2 Character Set 
Support of the server documentation.

Best regards
Ivo

Am Dienstag, 15. Juli 2008 16:14:25 schrieb Carol Walter:
> Hello,
>
> I have some databases that use SQL ASCII or Latin1 encoding that need
> to be UTF8.  When I have drop the database and recreated it with the
> correct encoding I get errors in restoring the data.  How is this done?
>
> Carol





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

* Changing encoding
@ 2008-11-18 18:06 Carol Walter <walterc@indiana.edu>
  2008-11-18 18:19 ` Re: Changing encoding Marcelo Costa <marcelojscosta@gmail.com>
  0 siblings, 1 reply; 6+ messages in thread

From: Carol Walter @ 2008-11-18 18:06 UTC (permalink / raw)
  To: pgsql-admin

Hello,

I have some databases that are designated as "SQL_ASCII" encoding.  I  
need them to be "UTF-8".  I know that "SQL_ASCII" is really the  
absence of encoding.  Is there a way to do this?

Carol



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

* Re: Changing encoding
  2008-11-18 18:06 Changing encoding Carol Walter <walterc@indiana.edu>
@ 2008-11-18 18:19 ` Marcelo Costa <marcelojscosta@gmail.com>
  0 siblings, 0 replies; 6+ messages in thread

From: Marcelo Costa @ 2008-11-18 18:19 UTC (permalink / raw)
  To: Carol Walter <walterc@indiana.edu>; +Cc: pgsql-admin

Hi Carol

On Tue, Nov 18, 2008 at 4:06 PM, Carol Walter <walterc@indiana.edu> wrote:

> Hello,
>
> I have some databases that are designated as "SQL_ASCII" encoding.  I need
> them to be "UTF-8".  I know that "SQL_ASCII" is really the absence of
> encoding.  Is there a way to do this?


Try use pg_dump on your ASCII database with option -E

ex.: pgdump -U user database -E UTF8 -f filename.sql


-- 
Marcelo Costa

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


end of thread, other threads:[~2008-11-18 18:19 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-07-15 14:14 Changing encoding Carol Walter <walterc@indiana.edu>
2008-07-15 15:04 ` Peter Eisentraut <peter_e@gmx.net>
2008-07-15 15:58   ` Carol Walter <walterc@indiana.edu>
2008-07-15 17:26 ` Ivo Rossacher <rossacher@bluewin.ch>
2008-11-18 18:06 Changing encoding Carol Walter <walterc@indiana.edu>
2008-11-18 18:19 ` Marcelo Costa <marcelojscosta@gmail.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