title: python + psycopg2 = unknown types?
body: <p>It seems when I use callproc(), psycopg2 isn't properly casting strings as text or character varying.</p>
  
  <p>For example:</p>
  
  <pre><code>values = [pid, 4, 4, 'bureau ama', 0, 130, row['report_dte'], row['report_dte'], 1, 1, 1, None, None, 'published', row['report_dte']]
  cur.callproc('header', values)
  </code></pre>
  
  <p>Yields:</p>
  
  <pre><code>psycopg2.ProgrammingError: function header(integer, integer, integer, unknown, integer, integer, unknown, unknown, integer, integer, integer, unknown, unknown, unknown, unknown) does not exist
  LINE 1: SELECT * FROM header(509952,4...
  </code></pre>
  
  <p>First, the "bureau ama" is unknown instead of text/character, and row["report_dte"] are all unknown, where they are date types in the database, and datetime.date objects in python.</p>
  
  <p>Any idea? Using python 2.6.5. Using cur.mogrify(), the query looks like:</p>
  
  <pre><code>SELECT header(509952,4,4,E'bureau ama',0,130,'2011-01-24','2011-01-24',1,1,1,NULL,NULL,E'published','2011-01-24')
  </code></pre>
  
  <p>Not sure what the <code>E'bureau pitcher ama'</code> means...</p>