title: PostgreSQL: 42883 Operator does not exist: timestamp without time zone = text
body: <p>I am using Npgsql 3.0.3.0 and PetaPoco latest version. </p>
  
  <p>When I run this command:</p>
  
  <pre><code>var dateCreated = DateTime.Now; // just an example
  var sql = new Sql("WHERE date_created = @0", dateCreated.ToString("yyyy-MM-dd HH:00:00"));
  var category = db.SingleOrDefault&lt;Category&gt;(sql);
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>Npgsql.NpgsqlException 42883: operator does not exist: timestamp
    without time zone = text</p>
  </blockquote>
  
  <p>I understand the error message is saying I'm trying to compare a timestamp (date) with a text, however for me it's perfectly valid to compare them as I am <em>expecting</em> the following SQL statement to be built:</p>
  
  <pre><code>SELECT * FROM category WHERE date_created = '2017-02-03 15:00:00'
  </code></pre>
  
  <p>I don't really want to typecast my database column to text for performance reasons. </p>