* Return a relInfo's tuple slot for a trigger's OLD tuples. */
| 1221 | * Return a relInfo's tuple slot for a trigger's OLD tuples. |
| 1222 | */ |
| 1223 | TupleTableSlot * |
| 1224 | ExecGetTriggerOldSlot(EState *estate, ResultRelInfo *relInfo) |
| 1225 | { |
| 1226 | if (relInfo->ri_TrigOldSlot == NULL) |
| 1227 | { |
| 1228 | Relation rel = relInfo->ri_RelationDesc; |
| 1229 | MemoryContext oldcontext = MemoryContextSwitchTo(estate->es_query_cxt); |
| 1230 | |
| 1231 | relInfo->ri_TrigOldSlot = |
| 1232 | ExecInitExtraTupleSlot(estate, |
| 1233 | RelationGetDescr(rel), |
| 1234 | table_slot_callbacks(rel)); |
| 1235 | |
| 1236 | MemoryContextSwitchTo(oldcontext); |
| 1237 | } |
| 1238 | |
| 1239 | return relInfo->ri_TrigOldSlot; |
| 1240 | } |
| 1241 | |
| 1242 | /* |
| 1243 | * Return a relInfo's tuple slot for a trigger's NEW tuples. |
no test coverage detected