Can a locked row [in Postgres] still be read from?

心不动则不痛 提交于 2019-12-23 07:47:18

问题


If I SELECT... FOR UPDATE a row in a transaction, it will obviously block the row from being written to, but will it disallow reads as well? I'd prefer to still be able to read from the row, so if the answer is yes, can you provide a solution to work this?


回答1:


You can read just fine. There are lock modes that prevent reading but this isn't one of them.

http://www.postgresql.org/docs/current/static/explicit-locking.html



来源:https://stackoverflow.com/questions/12029470/can-a-locked-row-in-postgres-still-be-read-from

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!