title: TypeError: argument 1 must be a string or unicode object
body: <p>Using this query:</p>
  
  <pre><code>04/25/2017 00:42:28.180 INFO (u"UPDATE posts SET translated_text='Unroll.me CEO dice que es &amp;quot;desgarrador&amp;quot; que los usuarios se molesten Unroll.me vendi\xf3 sus datos de correo electr\xf3nico anonimizado a Uber', detected_language='en' WHERE post_id=2", u'Unroll.me CEO dice que es &amp;quot;desgarrador&amp;quot; que los usuarios se molesten Unroll.me vendi\xf3 sus datos de correo electr\xf3nico anonimizado a Uber')
  </code></pre>
  
  <p>With <code>psycopg2</code>, when I use: <code>cur.execute(query)</code> I get:</p>
  
  <pre><code>TypeError: argument 1 must be a string or unicode object
  </code></pre>
  
  <p>What is the best option to use query and passing a unicode value. Currently Im already parametrizing the SQL query and passing the 'u'.</p>
  
  <pre><code>return u"UPDATE posts SET translated_text='%s', detected_language='%s' WHERE post_id=%s;" % (
          translation, detected_language['language'], str(post_id))
  </code></pre>
  
  <p>I added also without making a difference:</p>
  
  <pre><code>import psycopg2.extensions
  
  psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
  psycopg2.extensions.register_type(psycopg2.extensions.UNICODEARRAY)
  </code></pre>