Re: Encoding questions

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Pat Maddox <pergesu(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Encoding questions
Date: 2007-07-08 19:28:50
Message-ID: 7FCA9ADE-E7C9-4C0D-A66B-E7D241B92202@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2007-07-08 22:49:14 Re: [GENERAL] Unable to get postgres running after long time no vacuum
Previous Message Pat Maddox 2007-07-08 19:09:54 Encoding questions