title: PostgreSQL ERROR: function to_tsvector(character varying, unknown) does not exist
body: <p>This psql session snippet should be self-explanatory:</p>
  
  <pre><code>psql (9.1.7)
  Type "help" for help.
  =&gt; CREATE TABLE languages(language VARCHAR NOT NULL);
  CREATE TABLE
  =&gt; INSERT INTO languages VALUES ('english'),('french'),('turkish');
  INSERT 0 3
  =&gt; SELECT language, to_tsvector('english', 'hello world') FROM languages;
   language|     to_tsvector     
  ---------+---------------------
   english | 'hello':1 'world':2
   french  | 'hello':1 'world':2
   turkish | 'hello':1 'world':2
  (3 rows)
  
  =&gt; SELECT language, to_tsvector(language, 'hello world') FROM languages;
  ERROR:  function to_tsvector(character varying, unknown) does not exist
  LINE 1: select language, to_tsvector(language, 'hello world')...
                           ^
  HINT:  No function matches the given name and argument types.  
  You might need to add explicit type casts.
  </code></pre>
  
  <p>The problem is that Postgres function <code>to_tsvector</code> doesn't like <code>varchar</code> field type but this call should be perfectly correct <a href="http://www.postgresql.org/docs/9.1/static/textsearch-tables.html#TEXTSEARCH-TABLES-INDEX" rel="noreferrer">according to the documentation</a>?</p>