Re: Encoding questions - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: Encoding questions
Date
Msg-id 7FCA9ADE-E7C9-4C0D-A66B-E7D241B92202@seespotcode.net
Whole thread Raw
In response to Encoding questions  ("Pat Maddox" <pergesu@gmail.com>)
List pgsql-general
On Jul 8, 2007, at 14:09 , Pat Maddox wrote:

> Can I just convert it, or do I need to dump
> it, drop it, recreate with UTF-8, and then load the data?

It depends on what is currently in your (SQL_ASCII) database. If it's
only ASCII data or all non-ASCII data is UTF-8, you should be okay
just dumping the data and loading it into a new database with UTF8
encoding.

If this isn't the case, you'll need to clean the dump somehow,
probably using iconv.

> Also is it possible to change the default encoding for databases as
> well?

AFAIK, you can't change the default encoding after it's been set by
initdb, but you can set the encoding at database creation time. See
the CREATE DATABASE or createdb documentation on how to do this.

Michael Glaesemann
grzm seespotcode net



pgsql-general by date:

Previous
From: "Pat Maddox"
Date:
Subject: Encoding questions
Next
From: Alvaro Herrera
Date:
Subject: Re: Problem with autovacuum and pg_autovacuum