function convert_from(character varying, unknown) does not exist in Postgres

postgresql

Solution

From documentation: `convert_from(string bytea, src_encoding name)`. So cast artists to bytea:

select convert_from(artists::bytea, 'UTF8') from songs where     
to_tsvector('simple',convert_from(artists, 'UTF8')) 
  @@ plainto_tsquery('simple','alizee') 
limit 100

Problem

When i'm trying to convert from unicode to utf8 in the code below "function convert_from(character varying, unknown) does not exist" error occurs. ``` select convert_from(artists, 'UTF8') from songs where to_tsvector('simple',convert_from(artists, 'UTF8')) @@ plainto_tsquery('simple','alizee') limit 100 ``` Column "artists" has "TEXT" type. But when I'm running ``` select convert_from(E'\u0422\u0438\u043c\u0430\u0442\u0438', 'UTF8'); ``` it works well. How can I resolve this problem? I would appreciate any help. Thanks

Original source

Related problems