SELECT ... FOR UPDATE and ResultSet - Mailing list pgsql-jdbc

From Jeffrey Tenny
Subject SELECT ... FOR UPDATE and ResultSet
Date
Msg-id 3FF4C8D9.10102@comcast.net
Whole thread Raw
Responses Re: SELECT ... FOR UPDATE and ResultSet  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-jdbc
PostgreSQL will lock the rows identified by SELECT ... FOR UPDATE
even if I don't do anything with the ResultSet after
statement.executeQuery(),
at least in simple tests.

Is this the semantically correct result from a database standards
standpoint?
Can I count on this behavior for PostgreSQL?  Or will it fail to lock
all rows if
I have a sufficiently large ResultSet and Connection.setFetchSize() does
it's magic?

I notice that there is PostgreSQL documentation saying that the FOR
UPDATE stuff
logically happens after LIMIT.  The same logic might then conceptually
apply to ResultSets that don't acquire all query results from the server.

Thanks for any tips.



pgsql-jdbc by date:

Previous
From: Jeffrey Tenny
Date:
Subject: PostgreSQL design question
Next
From: Tom Lane
Date:
Subject: Re: SELECT ... FOR UPDATE and ResultSet