aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/matview.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/matview.c')
-rw-r--r--src/backend/commands/matview.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/backend/commands/matview.c b/src/backend/commands/matview.c
index 5a47be4b33c..5b2cbc7c89c 100644
--- a/src/backend/commands/matview.c
+++ b/src/backend/commands/matview.c
@@ -477,25 +477,24 @@ static bool
transientrel_receive(TupleTableSlot *slot, DestReceiver *self)
{
DR_transientrel *myState = (DR_transientrel *) self;
- HeapTuple tuple;
/*
- * get the heap tuple out of the tuple table slot, making sure we have a
- * writable copy
+ * Note that the input slot might not be of the type of the target
+ * relation. That's supported by table_insert(), but slightly less
+ * efficient than inserting with the right slot - but the alternative
+ * would be to copy into a slot of the right type, which would not be
+ * cheap either. This also doesn't allow accessing per-AM data (say a
+ * tuple's xmin), but since we don't do that here...
*/
- tuple = ExecCopySlotHeapTuple(slot);
- heap_insert(myState->transientrel,
- tuple,
- myState->output_cid,
- myState->hi_options,
- myState->bistate);
+ table_insert(myState->transientrel,
+ slot,
+ myState->output_cid,
+ myState->hi_options,
+ myState->bistate);
/* We know this is a newly created relation, so there are no indexes */
- /* Free the copied tuple. */
- heap_freetuple(tuple);
-
return true;
}