|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.161 2004/01/07 18:56:24 neilc Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.162 2004/01/16 20:51:30 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *
|
14 | 14 | * INTERFACE ROUTINES
|
@@ -1091,16 +1091,13 @@ heap_insert(Relation relation, HeapTuple tup, CommandId cid)
|
1091 | 1091 | HeapTupleHeaderSetCmin(tup->t_data, cid);
|
1092 | 1092 | tup->t_tableOid = relation->rd_id;
|
1093 | 1093 |
|
1094 |
| -#ifdef TUPLE_TOASTER_ACTIVE |
1095 |
| - |
1096 | 1094 | /*
|
1097 | 1095 | * If the new tuple is too big for storage or contains already toasted
|
1098 |
| - * attributes from some other relation, invoke the toaster. |
| 1096 | + * out-of-line attributes from some other relation, invoke the toaster. |
1099 | 1097 | */
|
1100 |
| - if (HeapTupleHasExtended(tup) || |
| 1098 | + if (HeapTupleHasExternal(tup) || |
1101 | 1099 | (MAXALIGN(tup->t_len) > TOAST_TUPLE_THRESHOLD))
|
1102 | 1100 | heap_tuple_toast_attrs(relation, tup, NULL);
|
1103 |
| -#endif |
1104 | 1101 |
|
1105 | 1102 | /* Find buffer to insert this tuple into */
|
1106 | 1103 | buffer = RelationGetBufferForTuple(relation, tup->t_len, InvalidBuffer);
|
@@ -1352,17 +1349,14 @@ heap_delete(Relation relation, ItemPointer tid,
|
1352 | 1349 |
|
1353 | 1350 | LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
|
1354 | 1351 |
|
1355 |
| -#ifdef TUPLE_TOASTER_ACTIVE |
1356 |
| - |
1357 | 1352 | /*
|
1358 |
| - * If the relation has toastable attributes, we need to delete no |
1359 |
| - * longer needed items there too. We have to do this before |
1360 |
| - * WriteBuffer because we need to look at the contents of the tuple, |
1361 |
| - * but it's OK to release the context lock on the buffer first. |
| 1353 | + * If the tuple has toasted out-of-line attributes, we need to delete |
| 1354 | + * those items too. We have to do this before WriteBuffer because we need |
| 1355 | + * to look at the contents of the tuple, but it's OK to release the |
| 1356 | + * context lock on the buffer first. |
1362 | 1357 | */
|
1363 |
| - if (HeapTupleHasExtended(&tp)) |
1364 |
| - heap_tuple_toast_attrs(relation, NULL, &(tp)); |
1365 |
| -#endif |
| 1358 | + if (HeapTupleHasExternal(&tp)) |
| 1359 | + heap_tuple_toast_attrs(relation, NULL, &tp); |
1366 | 1360 |
|
1367 | 1361 | pgstat_count_heap_delete(&relation->pgstat_info);
|
1368 | 1362 |
|
@@ -1572,11 +1566,11 @@ heap_update(Relation relation, ItemPointer otid, HeapTuple newtup,
|
1572 | 1566 | * implement UNDO and will re-use transaction IDs after postmaster
|
1573 | 1567 | * startup.
|
1574 | 1568 | *
|
1575 |
| - * We need to invoke the toaster if there are already any toasted values |
1576 |
| - * present, or if the new tuple is over-threshold. |
| 1569 | + * We need to invoke the toaster if there are already any out-of-line |
| 1570 | + * toasted values present, or if the new tuple is over-threshold. |
1577 | 1571 | */
|
1578 |
| - need_toast = (HeapTupleHasExtended(&oldtup) || |
1579 |
| - HeapTupleHasExtended(newtup) || |
| 1572 | + need_toast = (HeapTupleHasExternal(&oldtup) || |
| 1573 | + HeapTupleHasExternal(newtup) || |
1580 | 1574 | (MAXALIGN(newtup->t_len) > TOAST_TUPLE_THRESHOLD));
|
1581 | 1575 |
|
1582 | 1576 | newtupsize = MAXALIGN(newtup->t_len);
|
|
0 commit comments