title: Inserting a duplicate record using Npgsql
body: <p>I'm trying to insert data into the following table using the Npgsql ADO.NET provider:</p>
  
  <pre><code>CREATE SCHEMA core;
  
  CREATE TABLE core.config(
      name TEXT NOT NULL,
      value TEXT NOT NULL,
      CONSTRAINT pk_config PRIMARY KEY (name)
  );
  </code></pre>
  
  <p>The first insert works fine but if I try to insert an item with the same name again, Npgsql just hangs. I would expect an exception to be thrown stating that the primary key constraint has been violated, but Npgsql just freezes instead. Sure enough, if I check the server logs I see this:</p>
  
  <p><code>duplicate key value violates unique constraint "pk_config"</code></p>
  
  <p>but this message doesn't seem to be getting back to Npgsql. Am I doing something wrong? My code is here:</p>
  
  <pre><code>using (NpgsqlConnection conn = new NpgsqlConnection("Server=127.0.0.1;Port=5432;Database=temp;User Id=postgres;Password=test1"))
  {
      conn.Open();
      string cmdText = "INSERT INTO core.config(name, value) values ('item', 'value')";
      using (NpgsqlCommand cmd = new NpgsqlCommand(cmdText, conn))
      {
          cmd.ExecuteNonQuery(); // This works fine
          cmd.ExecuteNonQuery(); // Insert again: this hangs, but would expect an exception
      }
  }
  </code></pre>
  
  <p>This is a simplified version of a larger application (hence the use of a schema). I then tried creating the table in public (no schema specified). Interestingly this DOES generate an exception on the second call to <code>ExecuteNonQuery()</code>:</p>
  
  <p><code>Backend sent unrecognized response type</code></p>
  
  <p>I'm a little lost as to whether this is a bug in Npgsql or whether it is something to do with Schema privileges (even though for this test I'm using the "postgres" superuser).</p>
  
  <p>I'm using Npgsql 2.0.12.0</p>