The PostgreSQL 9.4 documentation states that adding the
NOWAIT option to a
SELECT FOR UPDATE means an error is generated when a row cannot be locked:
To prevent the operation from waiting for other transactions to commit, use the NOWAIT option. With NOWAIT, the statement reports an error, rather than waiting, if a selected row cannot be locked immediately.
Exactly what error would that be?
As this is an acceptable condition, I want my Java code to check for such an expected error and then work around it.