title: PostgreSQL, Npgsql returning 42601: syntax error at or near “$1”
body: <p>While passing PostgreSQL command following error</p>
  
  <blockquote>
    <p>42601: syntax error at or near "$1"</p>
  </blockquote>
  
  <pre><code>using (Npgsql.NpgsqlConnection conn = new Npgsql.NpgsqlConnection(DBManager.GetConnectionString()))
              {
                  conn.Open();
                  Logger.Info("connection opened for adding column");
                  using (Npgsql.NpgsqlCommand addColumnQuery = new Npgsql.NpgsqlCommand(@"ALTER TABLE @tableName ADD COLUMN IF NOT EXISTS @columnName  @columnType;", conn))
                  {
                      addColumnQuery.Parameters.AddWithValue("@tableName", tableName);
                      addColumnQuery.Parameters.AddWithValue("@columnName", columnName);
                      addColumnQuery.Parameters.AddWithValue("@columnType", columnType);
                      addColumnQuery.ExecuteNonQuery();
                  }
              }
  </code></pre>