* Return a relInfo's tuple slot for a trigger's NEW tuples. */
| 1243 | * Return a relInfo's tuple slot for a trigger's NEW tuples. |
| 1244 | */ |
| 1245 | TupleTableSlot * |
| 1246 | ExecGetTriggerNewSlot(EState *estate, ResultRelInfo *relInfo) |
| 1247 | { |
| 1248 | if (relInfo->ri_TrigNewSlot == NULL) |
| 1249 | { |
| 1250 | Relation rel = relInfo->ri_RelationDesc; |
| 1251 | MemoryContext oldcontext = MemoryContextSwitchTo(estate->es_query_cxt); |
| 1252 | |
| 1253 | relInfo->ri_TrigNewSlot = |
| 1254 | ExecInitExtraTupleSlot(estate, |
| 1255 | RelationGetDescr(rel), |
| 1256 | table_slot_callbacks(rel)); |
| 1257 | |
| 1258 | MemoryContextSwitchTo(oldcontext); |
| 1259 | } |
| 1260 | |
| 1261 | return relInfo->ri_TrigNewSlot; |
| 1262 | } |
| 1263 | |
| 1264 | /* |
| 1265 | * Return a relInfo's tuple slot for processing returning tuples. |
no test coverage detected