Thread: SQL ASCII encoding

SQL ASCII encoding

From
Frank Church
Date:
My databases are created in SQL ASCII by default.

Is there some disadvantage to this? As a British user, which is the preferred
character set and what advantage do I have to gain by using it?database


Re: SQL ASCII encoding

From
Martijn van Oosterhout
Date:
On Wed, Apr 05, 2006 at 01:35:00PM +0000, Frank Church wrote:
>
> My databases are created in SQL ASCII by default.
>
> Is there some disadvantage to this? As a British user, which is the preferred
> character set and what advantage do I have to gain by using it?database

SQL ASCII just means that the database will not do anything encoding
related for you. It won't check it nor will it convert anything.

The downside is that your apps could be uploading UTF-8, Latin-1,
Latin-9, anything and there will be no way to tell the difference. Also
things like upper(), lower() and case-comparison won't work on anything
other than ASCII characters.

If you setup your database to be UNICODE/UTF-8 then postgres can check
that the stuff you send is properly encoded. In your clients you should
do something like "set client_encoding=latin9" to ensure everything
gets converted up.

As a british user, latin9 will cover most of your needs, unless
ofcourse someone wants to enter their name in chinese :)

Have a nice day,
--
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

Re: SQL ASCII encoding

From
Harald Fuchs
Date:
In article <20060405135419.GD18401@svana.org>,
Martijn van Oosterhout <kleptog@svana.org> writes:

> As a british user, latin9 will cover most of your needs, unless
> ofcourse someone wants to enter their name in chinese :)

Since british users don't use French OE ligatures or Euro currency
signs, even latin1 would do.

Re: SQL ASCII encoding

From
Richard Jones
Date:
On Wed, Apr 05, 2006 at 10:15:18PM +0200, Harald Fuchs wrote:
> In article <20060405135419.GD18401@svana.org>,
> Martijn van Oosterhout <kleptog@svana.org> writes:
>
> > As a british user, latin9 will cover most of your needs, unless
> > ofcourse someone wants to enter their name in chinese :)
>
> Since british users don't use French OE ligatures or Euro currency
> signs, even latin1 would do.

However as a British PostgreSQL user, I would really like to encourage
the O.P. to use UNICODE for _every_ database.

My question: Is it possible to upgrade a database from ASCII to
UNICODE without dumping and restoring?

Rich.

--
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com