title: Postgres prepared statement error on setting parameter value in single quote
body: <p>I am using parameterized query to the Postgres database in C#. </p>
  
  <pre><code>NpgsqlCommand command = new NpgsqlCommand("(SELECT * " +
      "FROM ABC AS abc " +
      " WHERE abc.SomeDate &gt;= date_trunc('month', current_date) + interval '@periods' ");
  
  command.Parameters.AddWithValue("periods", NpgsqlDbType.Text, periods);
  </code></pre>
  
  <p>where periods value format = '-5 years' or '-2 years'</p>
  
  <p>On executing error is </p>
  
  <p><code>22007: invalid input syntax for type interval: "@periods"</code></p>
  
  <p>When I remove ' (single quote) from the <code>@periods</code>, It gives the error: </p>
  
  <p><code>Error: 42601: syntax error at or near "$2"</code></p>
  
  <p>Please suggest a way. Thanks.</p>