Search Postgresql Archives

a couple questions about convert()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

In a postgresql-9.3.1 database with UTF8 encoding I can do:

  select convert_from (E'\\x68656c6c6f', 'LATIN1');
   convert_from 
  --------------
   hello

But when I explicitly give the "to" encoding:

  select convert (E'\\x68656c6c6f', 'LATIN1', 'UTF8');
     convert    
  --------------
   \x68656c6c6f

Why does that second one give different results from the first? 

Second question: why is that none of the convert* functions are 
marked as immutable (thus preventing me from creating a functional 
index using them).  Surely if I convert \x68 to utf-8 the result
will *always* be "h", won't it?



-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux