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 是文本值。 expire_dt 是一个时间戳,默认为 现在()+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