Re: Change/convert encoding?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Erno Kuusela <erno(at)iki(dot)fi>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Change/convert encoding?
Date: 2000-10-09 22:35:05
Message-ID: 7708.971130905@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Erno Kuusela <erno(at)iki(dot)fi> writes:
> i have a database and in it strings with accented characters in
> latin-1 encoding, but the database has been mistakenly created with
> unicode encoding. as you all know this makes pg_dump break.

> what i'm enquiring is - is there a way to change the encoding
> and preserve the data? i only know of one way to specify the
> encoding, initdb -e, but afaik that will nuke all the data also.

I believe you could just reach into pg_database and update the
encoding field for that DB. Probably best to do so with a backend
connected to a different DB, like template1.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2000-10-09 22:44:27 ADO transaction funny
Previous Message Tom Lane 2000-10-09 22:23:34 Re: persistent db connections/resiliency