Message-ID: From: "davecramer (@davecramer)" To: "pgjdbc/pgjdbc" Date: Mon, 31 Oct 2022 18:03:15 +0000 Subject: Re: [pgjdbc/pgjdbc] issue #2656: Adaptive Fetch doesn't enable ResultSet streaming In-Reply-To: References: List-Id: X-GitHub-Author-Login: davecramer X-GitHub-Comment-Id: 1297468981 X-GitHub-Comment-Type: issue_comment X-GitHub-Issue: 2656 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-Type: comment X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/issues/2656#issuecomment-1297468981 Content-Type: text/plain; charset=utf-8 I tested the following code and it appears to work (note this is groovy, but add semicolons and it should compile) ``` class TestFetchSize { public static void main(String[] args) { Properties properties = new Properties() properties.setProperty(PGProperty.USER.getName(),"test") properties.setProperty(PGProperty.PASSWORD.getName(),"password") properties.setProperty(PGProperty.LOGGER_LEVEL.getName(), "TRACE") properties.setProperty(PGProperty.PREFER_QUERY_MODE.getName(),"extended") PGProperty.ADAPTIVE_FETCH.set(properties, true); DriverManager.setLogWriter(new PrintWriter(System.err)); Connection con = DriverManager.getConnection('jdbc:postgresql://localhost:5432/test',properties) con.setAutoCommit(false) Statement stmt = con.createStatement(); //ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY) stmt.setFetchSize(10) ResultSet rs = stmt.executeQuery('select * from fetchrows') while (rs.next()) { rs.getInt('id') } con.commit() con.close() } } ``` I tested this code and it does actually use cursors. Can you share your code ?