Thread: converting database to unicode

converting database to unicode

From
"Jason Tesser"
Date:
I have a database in sql_ascii that I need to convert to Unicode.  I tried using
pg_dump -Fc ..  but it fails on certain characters.  like this one "è"
How can I get the data transferred?


Re: converting database to unicode

From
"Jason Tesser"
Date:
Some help please?? :-) Anyone?


-----Original Message-----
From:    pgsql-general-owner@postgresql.org on behalf of Jason Tesser
Sent:    Wed 10/13/2004 10:00 AM
To:    pgsql-general@postgresql.org
Cc:
Subject:    [GENERAL] converting database to unicode
I have a database in sql_ascii that I need to convert to Unicode.  I tried using
pg_dump -Fc ..  but it fails on certain characters.  like this one "è"
How can I get the data transferred?


---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend





Re: converting database to unicode

From
Alvaro Herrera
Date:
On Fri, Oct 15, 2004 at 07:59:19AM -0500, Jason Tesser wrote:
> Some help please?? :-) Anyone?

Did you try recoding the plain-text dump using recode or iconv?


> -----Original Message-----
> From:    pgsql-general-owner@postgresql.org on behalf of Jason Tesser
> Sent:    Wed 10/13/2004 10:00 AM
> To:    pgsql-general@postgresql.org
> Cc:
> Subject:    [GENERAL] converting database to unicode
> I have a database in sql_ascii that I need to convert to Unicode.  I tried using
> pg_dump -Fc ..  but it fails on certain characters.  like this one "è"
> How can I get the data transferred?

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"No es bueno caminar con un hombre muerto"


Re: converting database to unicode

From
"Jason Tesser"
Date:
Uhh no.  Could you help me understand how to do that.  I am currently using the following to dump and restore
pg_dump -Fc --username=xxx --dbanme=xxx filename
pg_restore -Fc --username=xxx --dbname filename 

    -----Original Message----- 
    From: Alvaro Herrera [mailto:alvherre@dcc.uchile.cl] 
    Sent: Fri 10/15/2004 8:25 AM 
    To: Jason Tesser 
    Cc: pgsql-general@postgresql.org 
    Subject: Re: [GENERAL] converting database to unicode
    
    

    On Fri, Oct 15, 2004 at 07:59:19AM -0500, Jason Tesser wrote:
    > Some help please?? :-) Anyone?
    
    Did you try recoding the plain-text dump using recode or iconv?
    
    
    > -----Original Message-----
    > From: pgsql-general-owner@postgresql.org on behalf of Jason Tesser
    > Sent: Wed 10/13/2004 10:00 AM
    > To:   pgsql-general@postgresql.org
    > Cc:  
    > Subject:      [GENERAL] converting database to unicode
    > I have a database in sql_ascii that I need to convert to Unicode.  I tried using
    > pg_dump -Fc ..  but it fails on certain characters.  like this one "è"
    > How can I get the data transferred? 
    
    --
    Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
    "No es bueno caminar con un hombre muerto"
    
    


Re: converting database to unicode

From
Alvaro Herrera
Date:
On Fri, Oct 15, 2004 at 09:36:42AM -0500, Jason Tesser wrote:
> Uhh no.  Could you help me understand how to do that.  I am currently using the following to dump and restore
> pg_dump -Fc --username=xxx --dbanme=xxx filename
> pg_restore -Fc --username=xxx --dbname filename

Something like

pg_dump --username=xxx --dbname=yyy filename
recode latin1..utf8 filename
createdb -E utf8 database
psql < filename

(assuming the database is Latin1, a.k.a. iso-8859-1.  Update accordingly.)

I don't think you can do it with a -Fc or -Ft format.  In fact, if you
do that, the dump will be corrupted.


Huh, now I know why your name was so familiar to me (see sig)

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
Jason Tesser: You might not have understood me or I am not understanding you.
Paul Thomas: It feels like we're 2 people divided by a common language...