title: Postgres JDBC Error: Received resultset tuples, but no field structure for them
body: <p>We are using Postgres in a Java Spring application:</p>
  
  <p><strong>Postgres Version: 10</strong></p>
  
  <p><strong>Postgres JDBC Dependency Version: 42.1.4</strong></p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.postgresql&lt;/groupId&gt;
      &lt;artifactId&gt;postgresql&lt;/artifactId&gt;
      &lt;version&gt;42.1.4&lt;/version&gt;
      &lt;scope&gt;test&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>There is a random error in the same deployed code that can't be replicated in other environments; the error goes away on restarting the application. It seems to occur on a Select when authenticating a user.</p>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Received resultset tuples, but no field structure for them
      at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2121)
      at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)
      at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)
      at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)
      at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169)
      at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:117)
      at sun.reflect.GeneratedMethodAccessor126.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114)
      at com.sun.proxy.$Proxy129.executeQuery(Unknown Source)
      at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:60)
  </code></pre>
  
  <p>The closest I could find was this thread, but I don't understand the solution or whether it's available in any new versions. Is it a Postgres JDBC bug?
  <a href="http://www.pgpool.net/mantisbt/view.php?id=432" rel="nofollow noreferrer">http://www.pgpool.net/mantisbt/view.php?id=432</a></p>