Skip site navigation (1) Skip section navigation (2)

Re: not fetching all query results

From: Radim Kolar <hsn(at)filez(dot)com>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: PostgreSQL JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: not fetching all query results
Date: 2012-07-17 19:49:00
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
with 5m result set you can set fetchsize to any value it has no effect

@GrabConfig(systemClassLoader = true)
@Grab(group='postgresql', module='postgresql', version='8.3-603.jdbc4')
@Grab(group='commons-lang', module='commons-lang', version='2.6')

import groovy.sql.Sql
import org.apache.commons.lang.math.RandomUtils

def sql=Sql.newInstance("jdbc:postgresql://localhost/grails", 
"postgres", "postgres")

sql.withTransaction {
for (i in 1..5000000 ) {
   sql.executeUpdate("insert into public.test (a) values (?)", 

def c = sql.getConnection()
def s = c.createStatement()
def r = s.executeQuery("select * from public.test")
def cnt = 0
while ( {

println "${cnt} rows."


In response to


pgsql-jdbc by date

Next:From: Dave CramerDate: 2012-07-17 20:05:14
Subject: Re: not fetching all query results
Previous:From: Dave CramerDate: 2012-07-17 18:48:09
Subject: Re: not fetching all query results

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group