我有以下 plpgsql 函数:
CREATE FUNCTION user_delete(
IN id INT4
)
RETURNS VOID
AS
$BODY$
BEGIN
DELETE FROM user_role WHERE user_id = id;
DELETE FROM user_permission WHERE user_id = id;
DELETE FROM permission_cache WHERE user_id = id;
DELETE FROM access WHERE user_id = id;
DELETE FROM "user" WHERE user_id = id;
END;
$BODY$
LANGUAGE plpgsql VOLATILE;
是否可以通过一次选择更新查询来锁定所有表中与 used_id 相关的行?