Name

LockRow — 为表中的行设置锁定/授权。

Synopsis

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 是一个文本值。 expiredt 是一个时间戳,默认为 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