title: Postgres function(via npgsql) call to ExecuteNonQuery returns -1 as result for rows affected
body: <p>I have a simple function that just inserts the parameter values provided to it into columns in a table.</p>
  
  <p>When I run the function via the ExecuteNonQuery() method on the command object I always get -1, even if the insert took place.</p>
  
  <p>If i run the same query as a Text command it gives be the correct result of 1.</p>
  
  <p>I'm new to postgresql/npgsql. Is there trick to making the function feed back the number of rows affected? Something like "set nocount off" in SQL Server?</p>
  
  <p><strong>EDIT:</strong>
  The code I am using: (with npgsql 2.0.11)</p>
  
  <pre><code>var connStr = @"Server=127.0.0.1;Port=5432;User Id=postgres;Password=***;Database=Test;";
  using (var conn = new NpgsqlConnection(connStr)) {
      conn.Open();
      using (var cmd = conn.CreateCommand())
      {
          cmd.CommandText = "insert_something";
          cmd.CommandType = CommandType.StoredProcedure;
          NpgsqlCommandBuilder.DeriveParameters(cmd);
          cmd.Parameters["_id"].Value = 1;
          cmd.Parameters["_val"].Value = 2;
          var rowsAffected = cmd.ExecuteNonQuery();
          Console.WriteLine(rowsAffected);
      }
  }
  </code></pre>