mirror of
https://github.com/postgres/postgres.git
synced 2025-06-16 06:01:02 +03:00
Support data-modifying commands (INSERT/UPDATE/DELETE) in WITH.
This patch implements data-modifying WITH queries according to the semantics that the updates all happen with the same command counter value, and in an unspecified order. Therefore one WITH clause can't see the effects of another, nor can the outer query see the effects other than through the RETURNING values. And attempts to do conflicting updates will have unpredictable results. We'll need to document all that. This commit just fixes the code; documentation updates are waiting on author. Marko Tiikkaja and Hitoshi Harada
This commit is contained in:
@ -995,7 +995,7 @@ ExecuteTruncate(TruncateStmt *stmt)
|
||||
|
||||
/*
|
||||
* To fire triggers, we'll need an EState as well as a ResultRelInfo for
|
||||
* each relation.
|
||||
* each relation. We don't need to call ExecOpenIndices, though.
|
||||
*/
|
||||
estate = CreateExecutorState();
|
||||
resultRelInfos = (ResultRelInfo *)
|
||||
@ -1008,7 +1008,6 @@ ExecuteTruncate(TruncateStmt *stmt)
|
||||
InitResultRelInfo(resultRelInfo,
|
||||
rel,
|
||||
0, /* dummy rangetable index */
|
||||
CMD_DELETE, /* don't need any index info */
|
||||
0);
|
||||
resultRelInfo++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user