{"Entry":{"collection":"plan","key":"lockrows","name":"LockRows","aliases":["LockRows","T_LockRows"],"metadata":{"aliases":["LockRows","T_LockRows"],"category":"Control","content_hash":"799293bef5b0135fef7ebcbdb9c63a78774579c331cad7cd32c66101654d281b","imported_at":"2026-09-30T00:40:44.086311+08:00","name":"LockRows","name_zh":"LockRows","slug":"lockrows","summary":"Locks rows selected by its child for row-locking clauses."}},"Definition":{"Collection":"plan","Key":"lockrows","SourceDatabase":"center","Version":"18","SourceTable":"plan_node","SourceKey":"lockrows","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","Facts":{"comparison_data":{"initializer":"ExecInitLockRows","memory_mechanism":"unclassified","node_tag":"T_LockRows","parallel_callbacks":[],"partial_modes":[],"strategies":[],"text_names":["LockRows"]},"comparison_hash":"67f9133563e6e17a1409787c4b2ae050edaccb9feed71e462118303f83324626","description":["Locks rows selected by its child for row-locking clauses."],"evidence_kind":"source and documentation","explain_names":["LockRows"],"explain_prefixes":["Parallel","Async"],"facts":[{"label":"Core node tag","value":"T_LockRows"},{"label":"Structured EXPLAIN Node Type","value":"LockRows"},{"label":"Inputs","value":"One child plan with row identity information"},{"label":"Output","value":"Locked qualifying tuples"},{"label":"Executor initializer","value":"ExecInitLockRows"},{"label":"Memory mechanism","value":"unclassified"}],"memory":{"description":"This extraction does not assign a universal memory limit or spill policy to this node. Inspect the same-build implementation and its expressions or provider.","evidence":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/nodeLockRows.c","path":"src/backend/executor/nodeLockRows.c","sha256":"a6a30b944beee0590bdabee0ac2571bc1beb231a492df06c19017217daed357f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}],"mechanism":"unclassified","source_notes":[]},"node_tag":"T_LockRows","parallel_callbacks":[],"partial_modes":[],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"},{"label":"Using EXPLAIN","url":"/docs/18/using-explain.html"},{"label":"Parallel plans","url":"/docs/18/parallel-plans.html"},{"label":"Row locks","url":"/wiki/lock/?v=18"}],"release":{"channel":"stable","label":"18.6","major":"18","ref":"PostgreSQL 18.6 source archive","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_snapshot_utc":"","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},"runtime_verified":false,"sections":[{"paragraphs":["Structured formats use the Node Type above. Text-format spellings can also include operation, strategy, join type, scan direction or aggregation-stage attributes.","Text names recorded by this source: LockRows.","Parallel-aware and parallel-safe are different plan properties. A node running inside a parallel worker is not necessarily a parallel-aware node."],"title":"EXPLAIN names and attributes"},{"paragraphs":["This extraction does not assign a universal memory limit or spill policy to this node. Inspect the same-build implementation and its expressions or provider."],"title":"Memory and temporary storage"},{"paragraphs":["The source callbacks below can coordinate execution or collect worker instrumentation. Their presence is not a blanket claim that this node supports a shared parallel scan or shared state.","Callbacks in this build: none extracted from this node implementation."],"title":"Parallel execution and instrumentation"},{"paragraphs":["nodeLockRows.c Routines to handle FOR UPDATE/FOR SHARE row locking","We don't need EvalPlanQual unless we get updated tuple version(s)","Attempt to lock the source tuple(s). (Note we only have locking rowmarks in lr_arowMarks.)","if FDW says tuple was updated before getting locked, we need to perform EPQ testing to see if quals are still satisfied","The target tuple was already updated or deleted by the current command, or by a later command in the current transaction. We *must* ignore the tuple in the former case, so as to avoid the \"Halloween problem\" of repeated update attempts. In the latter case it might be sensible to fetch the updated tuple instead, but doing so would require changing heap_update and heap_delete to not complain about updating \"invisible\" tuples, which seems pretty scary (table_tuple_lock will not complain, but few callers expect TM_Invisible, and we're not one of them). So for now, treat the tuple as deleted and do not process."],"title":"Executor implementation notes"},{"code":"case T_LockRows:\n\t\t\tpname = sname = \"LockRows\";\n\t\t\tbreak;","title":"EXPLAIN identity in core source"}],"source_inventory":{"executor":"src/backend/executor/execProcnode.c","explain":"src/backend/commands/explain.c","implementation":"src/backend/executor/nodeLockRows.c"},"sources":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/commands/explain.c:1598","line":1598,"path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/execProcnode.c:375","line":375,"path":"src/backend/executor/execProcnode.c","sha256":"f8a06a3f539077249b20664b2812433db6d7bd12b2c0ca633525db43d06f112a","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/nodeLockRows.c","path":"src/backend/executor/nodeLockRows.c","sha256":"a6a30b944beee0590bdabee0ac2571bc1beb231a492df06c19017217daed357f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/include/nodes/plannodes.h","path":"src/include/nodes/plannodes.h","sha256":"52422b327a8049fbbb20d8b96008a0fc0a6fafa60f7eff3c695d5b2e83830120","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}],"strategies":[],"tables":[{"columns":[{"key":"label","label":"Text-format label"},{"key":"identity","label":"Structured node identity"}],"key":"explain-labels","rows":[{"identity":"LockRows","label":"LockRows"}],"title":"EXPLAIN labels in this source build"}]},"ManualEvidence":{"release":{"channel":"stable","label":"18.6","major":"18","ref":"PostgreSQL 18.6 source archive","revision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","source_snapshot_utc":"","source_url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},"sources":[{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/commands/explain.c:1598","line":1598,"path":"src/backend/commands/explain.c","sha256":"34c86d6070224a0e981efef51f79101d6d505e5874f1684ace183034bab14bb4","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/execProcnode.c:375","line":375,"path":"src/backend/executor/execProcnode.c","sha256":"f8a06a3f539077249b20664b2812433db6d7bd12b2c0ca633525db43d06f112a","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/backend/executor/nodeLockRows.c","path":"src/backend/executor/nodeLockRows.c","sha256":"a6a30b944beee0590bdabee0ac2571bc1beb231a492df06c19017217daed357f","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"},{"archive_sha256":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","label":"src/include/nodes/plannodes.h","path":"src/include/nodes/plannodes.h","sha256":"52422b327a8049fbbb20d8b96008a0fc0a6fafa60f7eff3c695d5b2e83830120","url":"https://ftp.postgresql.org/pub/source/v18.6/postgresql-18.6.tar.bz2"}]},"MeasuredEvidence":{"runtime_verified":false}},"Text":{"Collection":"plan","Key":"lockrows","SourceDatabase":"center","Version":"18","Locale":"en","Title":"LockRows","Summary":"Locks rows selected by its child for row-locking clauses.","BodyHTML":"\u003cp\u003eLocks rows selected by its child for row-locking clauses.\u003c/p\u003e","SourceRevision":"555610c24d53e4316da5b7d3fc25c279d96856d5e0e23ee308c328c5fa881d9f","ContentHash":"2318efa9a57e3ec98af079490de95e4c5c09f90fdc9278378172c53493d15456","Payload":{"description":["Locks rows selected by its child for row-locking clauses."],"related":[{"label":"EXPLAIN","url":"/wiki/sql/explain/?v=18"},{"label":"Using EXPLAIN","url":"/docs/18/using-explain.html"},{"label":"Parallel plans","url":"/docs/18/parallel-plans.html"},{"label":"Row locks","url":"/wiki/lock/?v=18"}],"sections":[{"paragraphs":["Structured formats use the Node Type above. Text-format spellings can also include operation, strategy, join type, scan direction or aggregation-stage attributes.","Text names recorded by this source: LockRows.","Parallel-aware and parallel-safe are different plan properties. A node running inside a parallel worker is not necessarily a parallel-aware node."],"title":"EXPLAIN names and attributes"},{"paragraphs":["This extraction does not assign a universal memory limit or spill policy to this node. Inspect the same-build implementation and its expressions or provider."],"title":"Memory and temporary storage"},{"paragraphs":["The source callbacks below can coordinate execution or collect worker instrumentation. Their presence is not a blanket claim that this node supports a shared parallel scan or shared state.","Callbacks in this build: none extracted from this node implementation."],"title":"Parallel execution and instrumentation"},{"paragraphs":["nodeLockRows.c Routines to handle FOR UPDATE/FOR SHARE row locking","We don't need EvalPlanQual unless we get updated tuple version(s)","Attempt to lock the source tuple(s). (Note we only have locking rowmarks in lr_arowMarks.)","if FDW says tuple was updated before getting locked, we need to perform EPQ testing to see if quals are still satisfied","The target tuple was already updated or deleted by the current command, or by a later command in the current transaction. We *must* ignore the tuple in the former case, so as to avoid the \"Halloween problem\" of repeated update attempts. In the latter case it might be sensible to fetch the updated tuple instead, but doing so would require changing heap_update and heap_delete to not complain about updating \"invisible\" tuples, which seems pretty scary (table_tuple_lock will not complain, but few callers expect TM_Invisible, and we're not one of them). So for now, treat the tuple as deleted and do not process."],"title":"Executor implementation notes"},{"code":"case T_LockRows:\n\t\t\tpname = sname = \"LockRows\";\n\t\t\tbreak;","title":"EXPLAIN identity in core source"}],"tables":[{"columns":[{"key":"label","label":"Text-format label"},{"key":"identity","label":"Structured node identity"}],"key":"explain-labels","rows":[{"identity":"LockRows","label":"LockRows"}],"title":"EXPLAIN labels in this source build"}]}},"RequestedLocale":"zh-Hans","Fallback":true,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
