Re: postgres & server encodings - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: postgres & server encodings
Date
Msg-id 20050809155946.GF8244@svana.org
Whole thread Raw
In response to postgres & server encodings  ("Salem Berhanu" <salemb4@hotmail.com>)
Responses Re: postgres & server encodings  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: postgres & server encodings  (Lincoln Yeoh <lyeoh@pop.jaring.my>)
List pgsql-general
On Mon, Aug 08, 2005 at 04:10:50PM +0000, Salem Berhanu wrote:
> What exactly is the SQL_ASCII encoding in postgres? I have a pg
> installation with an SQL_ASCII server encoding and my database (also
> SQL_ASCII) seems to be able to handle all types of encodings? how is this
> possible? is this what the server & db encoding needs to be set to in order
> to handle various encodings?

SQL_ASCII means that the database does no locale specific or language
specific encoding ever. It won't check what you send it either. If
you're content to let clients deal with any encoding issues, this may
be what you want.

But anything to do with lower(), upper(), case-insenstive in the
database itself will be totally stupid since it's assuming ASCII.

> Also is there a way of dumping data from an SQL_ASCII db to a UNICODE db.
> Creating a dump and converting with a tool like iconv is probably not an
> option since the data in the SQL_ASCII db has unknown/inconsistant encoding.
> Please let me know as soon as possible.

This is a messy situation. Since the system can't guess your encoding
you'd have to fix it all up yourself...

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: postgres & server encodings
Next
From: Tom Lane
Date:
Subject: Re: Reference new.* or old.* in dynamic statement?