背景 社内でデータベース研修が始まったため、いい機会なのでMacにPostgreSQLを入れて遊んでみました。 インストールはここを参照したら簡単でした。 研修はOracleの教科書で進んでいますがまあ基本的な概念は同じですね。 まとめてみると、どういうときにロック取得できないのかが意外と理解できてないことがわかりました。 行ロックの取得(select for update) Transaction A nsdb=# begin; BEGIN nsdb=# update hello set value = 'ngdesuyo' where num = 3; UPDATE 1 nsdb=# update hello set value = 'ngdesuyo' where num = 2; UPDATE 1