名前

LockRow — テーブルの指定した行についてロック/認証を設定します.

概要

integer LockRow(text a_schema_name, text a_table_name, text a_row_key, text an_auth_token, timestamp expire_dt);

integer LockRow(text a_table_name, text a_row_key, text an_auth_token, timestamp expire_dt);

integer LockRow(text a_table_name, text a_row_key, text an_auth_token);

説明

テーブルの指定した行についてロック/認証を設定します. <authid>は文字列値です.<expires>はタイムスタンプ値で,now()+1時間がデフォルトです.ロックされた場合は1を返し,他の場合(既に他の認証によってロックされている場合)には,0を返します.

初出バージョン: 1.1.3

SELECT LockRow('public', 'towns', '2', 'joey');
LockRow
-------
1

--Joey has already locked the record and Priscilla is out of luck
SELECT LockRow('public', 'towns', '2', 'priscilla');
LockRow
-------
0

		

関連情報

UnlockRows