Re: Default PostgreSQL server encoding - Change to unicode (utf8) - Mailing list pgsql-general

From Léa Massiot
Subject Re: Default PostgreSQL server encoding - Change to unicode (utf8)
Date
Msg-id 1330343743050-5518720.post@n5.nabble.com
Whole thread Raw
In response to Re: Default PostgreSQL server encoding - Change to unicode (utf8)  (Adrian Klaver <adrian.klaver@gmail.com>)
Responses Re: Default PostgreSQL server encoding - Change to unicode (utf8)
List pgsql-general
Hello.
Thank you for your answer.
I used the <raw> and </raw> tags, this is probably the reason
why you couldn't see the messages...
Thank you for the two links.
I read this (in the second one): "On Windows, however, UTF-8 encoding can be
used with any locale." yet I still have some questions...

On Unix (Debian GNU Linux Squeeze):

=========================================================================================
  psql_cmd> \l

  ----------+----------+----------+-------------+------------
  Name      | Owner    | Encoding | Collation   | Ctype
  ----------+----------+----------+-------------+------------
  template1 | postgres | UTF8     | en_us.UTF-8 | en_us.UTF-8

=========================================================================================

On Windows (XP):

=========================================================================================
  psql_cmd> \l


----------+----------+----------+----------------------------+---------------------------
  Name      | Owner    | Encoding | Collation                  | Ctype

----------+----------+----------+----------------------------+---------------------------
  template1 | postgres | UTF8     | English_United States.1252 |
English_United States.1252

=========================================================================================

Question 1
  Focusing on the "Collation" and "Ctype" columns,
  has "English_United States.1252" something to do with "Windows-1252"
("CP-1252")?
  "CP-1252" is an 8 bits character encoding (so, it can map codes to 2^8
characters at most).
  How compatible is this with an "UTF8" "Encoding"?
  For people testing PostgreSQL under Windows, is there any other more
appropriate "Collation" that could be used to set a database collation?
  There is no "locale -a" command avaiblable under Windows. Is there any
workaround?

Question 2
  Suppose I have a PostgreSQL table which has a VARCHAR column "text".
  Suppose I want to insert the string "Li 李" which contains the Chinese
ideograph 李.
  How can I do this with an "INSERT INTO" command?
  I wish I could do something like:
  INSERT INTO t (text) VALUES ('Li U+674E')
  or
  INSERT INTO t (text) VALUES ('Li \u674E')
  How can I do this?

Thanks and best regards.
--
Léa

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Default-PostgreSQL-server-encoding-Change-to-unicode-utf8-tp5505985p5518720.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

pgsql-general by date:

Previous
From: Stefan Keller
Date:
Subject: Re: Four issues why "old elephants" lack performance: Explanation sought Four issues why "old elephants" lack performance: Explanation sought
Next
From: Chris Travers
Date:
Subject: Re: Four issues why "old elephants" lack performance: Explanation sought Four issues why "old elephants" lack performance: Explanation sought