title: Postgres - temporary file size exceeds temp_file_limit
body: <p>I tried issuing a read all request (select * from tblName) using JDBC cursors (setFetchSize). The temp_file_limit property in postgresql.conf is 500 KB. When I execute the prepared statement, I get a psql exception - </p>
  
  <blockquote>
    <p>org.postgresql.util.PSQLException: ERROR: temporary file size exceeds temp_file_limit (500kB) </p>
  </blockquote>
  
  <p>The documentation in PostgreSQL.conf says "# limits per-session temp file space". 
  <a href="https://jdbc.postgresql.org/documentation/head/query.html#query-with-cursor" rel="nofollow noreferrer">https://jdbc.postgresql.org/documentation/head/query.html#query-with-cursor</a> as per this link, the connection must have disabled auto-commit and I had not disabled it. I did that as well, yet I ended up with the same issue. My understanding is that such large read operations are written to a temporary file before loading to the resultset. If this is the case then with a low temp_file_limit, I will never be able to read very large data, even with a cursor. This does not make sense to why it is made configurable in the first place. </p>
  
  <p>Setting the temp_file_limit to -1 (unbounded file size) solved this issue for me. Am I correct in taking this approach?</p>