Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: Database Encoding


  • From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
  • To: aarni(at)kymi(dot)com
  • Cc: operationsengineer1(at)yahoo(dot)com, pgsql-novice(at)postgresql(dot)org
  • Subject: Re: Database Encoding
  • Date: Sat, 16 Apr 2005 12:18:35 -0400
  • Message-id: <13225.1113668315@sss.pgh.pa.us> <text/plain>

Aarni =?iso-8859-1?q?Ruuhim=E4ki?= <aarni(at)kymi(dot)com> writes:
> initdb -E LATIN1 ..., so one way to change it is to re-init.

> You can create databases with different encoding (from template1) with same 
> switch e.g. 

> createdb mydb -E UTF8 ...

Note that in most cases you can't just whack the encoding around without
paying attention to locale.  I believe the only locale that really works
with multiple encodings is "C" --- all the other ones assume a
particular encoding.  You'll get very odd and unpleasant results from
text sorting and functions like upper/lower if you have the database
locale and encoding set incompatibly.

Unfortunately we don't currently support changing locale on the fly ---
so you can only set it at initdb time.  So the -E switch to createdb
is a bit dangerous.

This stuff is covered in the docs at
http://www.postgresql.org/docs/8.0/static/charset.html

			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group