Top PostgreSQL function for ascii 152 character ("ÿ")

On the Windows platform 7 PostgreSQL version 9.3.9 using PgAdminas a result of the upper level client selection in a column containing, for example "ÿÿÿ", returns null. If three values ​​are stored, for example,

"ada"
"john"
"mole" 
"ÿÿÿ"

they are all returned in uppercase, except for a string containing "ÿÿÿ"; this line returns nothing null...

The coding scheme database UTF8 / UNICODE.parameter "client_encoding" has the same meaning UNICODE.

This is a configuration issue in databasethe problem with the operating system or an error in the database? Are there any recommended workarounds?

Result:

select thecol, upper(thecol), upper(thecol) is null, convert_to(thecol, 'UTF8'), current_setting('server_encoding') from thetable where ... 

is an:

"Apps";"APPS";f;"Apps";"UTF8"
"All";"ALL";f;"All";"UTF8"
"Test";"TEST";f;"Test";"UTF8"
"ÿÿÿ";"";f;"\303\277\303\277\303\277";"UTF8"

Parts lc_of pg_settings parts:

"lc_collate";"Swedish_Sweden.1252";"Shows the collation order locale."
"lc_ctype";"Swedish_Sweden.1252";"Shows the character classification and case conversion locale."
"lc_messages";"Swedish_Sweden.1252";"Sets the language in which messages are displayed."
"lc_monetary";"Swedish_Sweden.1252";"Sets the locale for formatting monetary amounts."
"lc_numeric";"Swedish_Sweden.1252";"Sets the locale for formatting numbers."

Conclusion select * from pg_database:

"template1";10;6;"Swedish_Sweden.1252";"Swedish_Sweden.1252";t;t;-1;12130;668;1‌​;1663;"{=c/postgres,postgres=CTc/postgres}" 
"template0";10;6;"Swedish_Sweden.1252";"Swedish_Sweden.1252";t;f;-1;12130;668;1‌​;1663;"{=c/postgres,postgres=CTc/postgres}"
"postgres";10;6;"Swedish_Sweden.1252";"Swedish_Sweden.1252";f;t;-1;12130;668;1;‌​1663;""

9.4.4:

CREATE DATABASE postgres
  WITH OWNER = postgres
       ENCODING = 'UTF8'
       TABLESPACE = pg_default
       LC_COLLATE = 'Swedish_Sweden.1252'
       LC_CTYPE = 'Swedish_Sweden.1252'
       CONNECTION LIMIT = -1;
+4
1

, upper LC_CTYPE . LATIN SMALL LETTER Y WITH DIAERESIS (U + 00FF) Y (U + 0178), Windows 1252.

Unicode, upper :

SELECT upper(convert_to(thecol, 'UTF8')) ...

, LC_CTYPE LC_COLLATE. Linux sv_SE.UTF-8.

, ​​Postgres. ÿ, ​​ .

+1

Source: https://habr.com/ru/post/1608277/


All Articles