title: Npgsql throws incorrect Exception
body: <p>I am having a strange issue with <code>Npgsql</code>. I try to delete a record in a table that has a foreign key and is still in use. The command line of Postgres gives me a <code>Key is still referenced</code> error, which is expected.</p>
  
  <p>However, if I try to do that with <code>Npgsql</code> from my application, I get the following exception:</p>
  
  <blockquote>
    <p>Backend sent unrecognized response type: e</p>
  </blockquote>
  
  <p>according to sources on the internet, this is most likely caused by multi-threading, but I do not use another thread in this application. I checked and all code runs on the "Main Thread".</p>
  
  <p>Then, if I catch that exception and try to query my database again with this code:</p>
  
  <pre><code>DataSet ds = new DataSet();
  NpgsqlDataAdapter da = new NpgsqlDataAdapter(cmd);
  ds.Reset();
  da.Fill(ds);
  </code></pre>
  
  <p>I get this exception:</p>
  
  <blockquote>
    <p>Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream.</p>
  </blockquote>
  
  <p>All I want, is just catch the error, tell the user he cannot delete the record and be done. Now, it takes down the entire application for no good reason.</p>