2626 *
2727 *
2828 * IDENTIFICATION
29- * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.252 2005/08/01 20:31:07 tgl Exp $
29+ * $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.253 2005/08/18 21:34:20 tgl Exp $
3030 *
3131 *-------------------------------------------------------------------------
3232 */
@@ -1371,7 +1371,6 @@ ExecInsert(TupleTableSlot *slot,
13711371HeapTuple tuple ;
13721372ResultRelInfo * resultRelInfo ;
13731373Relation resultRelationDesc ;
1374- int numIndices ;
13751374Oid newId ;
13761375
13771376/*
@@ -1418,6 +1417,9 @@ ExecInsert(TupleTableSlot *slot,
14181417
14191418/*
14201419 * insert the tuple
1420+ *
1421+ * Note: heap_insert returns the tid (location) of the new tuple
1422+ * in the t_self field.
14211423 */
14221424newId = heap_insert (resultRelationDesc ,tuple ,
14231425estate -> es_snapshot -> curcid ,
@@ -1429,14 +1431,9 @@ ExecInsert(TupleTableSlot *slot,
14291431setLastTid (& (tuple -> t_self ));
14301432
14311433/*
1432- * process indices
1433- *
1434- * Note: heap_insert adds a new tuple to a relation. As a side effect,
1435- * the tupleid of the new tuple is placed in the new tuple's t_ctid
1436- * field.
1434+ * insert index entries for tuple
14371435 */
1438- numIndices = resultRelInfo -> ri_NumIndices ;
1439- if (numIndices > 0 )
1436+ if (resultRelInfo -> ri_NumIndices > 0 )
14401437ExecInsertIndexTuples (slot ,& (tuple -> t_self ),estate , false);
14411438
14421439/* AFTER ROW INSERT Triggers */
@@ -1563,7 +1560,6 @@ ExecUpdate(TupleTableSlot *slot,
15631560Relation resultRelationDesc ;
15641561ItemPointerData ctid ;
15651562HTSU_Result result ;
1566- int numIndices ;
15671563
15681564/*
15691565 * abort the operation if not running transactions
@@ -1676,23 +1672,18 @@ lreplace:;
16761672/*
16771673 * Note: instead of having to update the old index tuples associated
16781674 * with the heap tuple, all we do is form and insert new index tuples.
1679- * This is because UPDATEs are actually DELETEs and INSERTs and index
1675+ * This is because UPDATEs are actually DELETEs and INSERTs, and index
16801676 * tuple deletion is done automagically by the vacuum daemon. All we
16811677 * do is insert new index tuples. -cim 9/27/89
16821678 */
16831679
16841680/*
1685- *process indices
1681+ *insert index entries for tuple
16861682 *
1687- * heap_update updates a tuple in the base relation by invalidating it
1688- * and then inserting a new tuple to the relation.As a side effect,
1689- * the tupleid of the new tuple is placed in the new tuple's t_ctid
1690- * field. So we now insert index tuples using the new tupleid stored
1691- * there.
1683+ * Note: heap_update returns the tid (location) of the new tuple
1684+ * in the t_self field.
16921685 */
1693-
1694- numIndices = resultRelInfo -> ri_NumIndices ;
1695- if (numIndices > 0 )
1686+ if (resultRelInfo -> ri_NumIndices > 0 )
16961687ExecInsertIndexTuples (slot ,& (tuple -> t_self ),estate , false);
16971688
16981689/* AFTER ROW UPDATE Triggers */