Is there a way to select rows in Postgresql that aren\'t locked? I have a multi-threaded app that will do:
Select... order by id desc limit 1 for update
If you are trying to implement a queue, take a look at PGQ, which has solved this and other problems already. http://wiki.postgresql.org/wiki/PGQ_Tutorial