8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.78 2000/07/0401:39:24 vadim Exp $
11
+ * $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.79 2000/07/0417:11:40 wieck Exp $
12
12
*
13
13
*
14
14
* INTERFACE ROUTINES
@@ -1564,6 +1564,19 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
1564
1564
newtup -> t_data -> t_infomask &= ~(HEAP_XACT_MASK );
1565
1565
newtup -> t_data -> t_infomask |= (HEAP_XMAX_INVALID |HEAP_UPDATED );
1566
1566
1567
+ #ifdef TUPLE_TOASTER_ACTIVE
1568
+ /* ----------
1569
+ * If this relation is enabled for toasting, let the toaster
1570
+ * delete not any longer needed entries and create new ones to
1571
+ * make the new tuple fit again.
1572
+ * ----------
1573
+ */
1574
+ if (HeapTupleHasExtended (& oldtup )||
1575
+ HeapTupleHasExtended (newtup )||
1576
+ (MAXALIGN (newtup -> t_len )> (MaxTupleSize /4 )))
1577
+ heap_tuple_toast_attrs (relation ,newtup ,& oldtup );
1578
+ #endif
1579
+
1567
1580
/* Find buffer for new tuple */
1568
1581
1569
1582
if ((unsigned )MAXALIGN (newtup -> t_len ) <=PageGetFreeSpace ((Page )dp ))
@@ -1582,19 +1595,6 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
1582
1595
oldtup .t_data -> t_infomask &= ~(HEAP_XMAX_COMMITTED |
1583
1596
HEAP_XMAX_INVALID |HEAP_MARKED_FOR_UPDATE );
1584
1597
1585
- #ifdef TUPLE_TOASTER_ACTIVE
1586
- /* ----------
1587
- * If this relation is enabled for toasting, let the toaster
1588
- * delete not any longer needed entries and create new ones to
1589
- * make the new tuple fit again.
1590
- * ----------
1591
- */
1592
- if (HeapTupleHasExtended (& oldtup )||
1593
- HeapTupleHasExtended (newtup )||
1594
- (MAXALIGN (newtup -> t_len )> (MaxTupleSize /4 )))
1595
- heap_tuple_toast_attrs (relation ,newtup ,& oldtup );
1596
- #endif
1597
-
1598
1598
/* record address of new tuple in t_ctid of old one */
1599
1599
oldtup .t_data -> t_ctid = newtup -> t_self ;
1600
1600