Re: ResultSet storing all rows with defaulftFetchSize to 5000

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com>
Cc: Jaime Soler <jaime(dot)soler(at)gmail(dot)com>, Dave Cramer <pg(at)fastcrypt(dot)com>, Brad DeJong <bpd0018(at)gmail(dot)com>, List <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: ResultSet storing all rows with defaulftFetchSize to 5000
Date: 2018-02-12 15:58:57
Message-ID: 3558.1518451137@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Vladimir Sitnikov <sitnikov(dot)vladimir(at)gmail(dot)com> writes:
> I have no idea why PostgreSQL closes all the cursors as transaction
> ends,

Because the SQL standard says so. If a cursor isn't declared WITH HOLD,
then it's implicitly closed at transaction commit, cf SQL:2011 4.33
"Cursors":

An open cursor that was not defined as a holdable cursor is also
closed by a <commit statement>.

Also, 14.2 <cursor properties> says that WITHOUT HOLD is the default
assumption if you don't explicitly say WITH HOLD.

(Yes, we do support WITH HOLD.)

regards, tom lane

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Jaime Soler 2018-02-12 16:08:41 Re: ResultSet storing all rows with defaulftFetchSize to 5000
Previous Message Vladimir Sitnikov 2018-02-12 15:45:05 Re: ResultSet storing all rows with defaulftFetchSize to 5000