enhance tuple lock

This commit is contained in:
chenxiaobin19
2021-12-16 20:37:27 +08:00
parent 2417964517
commit 899cd4a36c
92 changed files with 4402 additions and 1177 deletions

View File

@ -654,10 +654,18 @@ static ForeignScan *postgresGetForeignPlan(PlannerInfo *root, RelOptInfo *basere
* complete information about, and (b) it wouldn't work anyway on
* older remote servers. Likewise, we don't worry about NOWAIT.
*/
if (rc->forUpdate) {
appendStringInfoString(&sql, " FOR UPDATE");
} else {
appendStringInfoString(&sql, " FOR SHARE");
switch (rc->strength) {
case LCS_FORKEYSHARE:
case LCS_FORSHARE:
appendStringInfoString(&sql, " FOR SHARE");
break;
case LCS_FORNOKEYUPDATE:
case LCS_FORUPDATE:
appendStringInfoString(&sql, " FOR UPDATE");
break;
default:
ereport(ERROR, (errmsg("unknown lock type: %d", rc->strength)));
break;
}
}
}