Exactly what error is returned by PostgreSQL `FOR UPDATE NOWAIT` when a selected row cannot be locked immediately?
SQLState: 55P03

In Postgres 9.4.x I tested this by performing an unresolved SELECT FOR UPDATE in pgAdmin and then doing a SELECT FOR UPDATE NOWAIT in my Java app. I used the JDBC driver JDBC41 Postgresql Driver, Version 9.4-1201.

The result was the following PostgreSQL Error Code.


Message:ERROR: could not obtain lock on row in relation "my_table_"
Class:Class 55 — Object Not In Prerequisite State
SQLState:55P03
Condition Name:lock_not_available