名前

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);

説明

テーブル内の指定した行にロック/認可を設定します。an_auth_tokenはテキスト値です。expire_dtnow() + 1 時間をデフォルトとするタイムスタンプです。割り当てが行われたなら1が返り、他の場合 (例: 行が他の認可で既にロックされていた)には0が返ります。

Availability: 1.1.3

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

-- Joeyは既にレコードをロックしていて
-- Priscillaはロックできなかっただけにラックが無かったと
SELECT LockRow('public', 'towns', '2', 'priscilla');
LockRow
-------
0

                

関連情報

UnlockRows