summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-11-20 18:38:20 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-11-20 18:38:20 +0000
commit40314f2dac2ecb2974d03c064917a70de74c63d5 (patch)
treeaa1f4d3aa30edf40a953dcc5e2b40bd342e96a8c /src/include
parent33a9af738d24766ea487c56c2287102a9214c891 (diff)
downloadpostgresql-40314f2dac2ecb2974d03c064917a70de74c63d5.tar.gz
Modify tuptoaster's API so that it does not try to modify the passed
tuple in-place, but instead passes back an all-new tuple structure if any changes are needed. This is a much cleaner and more robust solution for the bug discovered by Alexey Beschiokov; accordingly, revert the quick hack I installed yesterday. With this change, HeapTupleData.t_datamcxt is no longer needed; will remove it in a separate commit in HEAD only.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/tuptoaster.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/include/access/tuptoaster.h b/src/include/access/tuptoaster.h
index b45df277b1..b5870e69dc 100644
--- a/src/include/access/tuptoaster.h
+++ b/src/include/access/tuptoaster.h
@@ -6,7 +6,7 @@
*
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/include/access/tuptoaster.h,v 1.23 2005/07/06 19:02:53 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/access/tuptoaster.h,v 1.24 2005/11/20 18:38:20 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -66,19 +66,21 @@
/* ----------
- * heap_tuple_toast_attrs() -
+ * toast_insert_or_update -
*
- * Called by heap_insert(), heap_update() and heap_delete().
- * Outdates any no-longer-needed toast entries referenced
- * by oldtup and creates new ones until newtup is no more than
- * TOAST_TUPLE_TARGET (or we run out of toastable values).
- * Possibly modifies newtup by replacing the t_data part!
+ * Called by heap_insert() and heap_update().
+ * ----------
+ */
+extern HeapTuple toast_insert_or_update(Relation rel,
+ HeapTuple newtup, HeapTuple oldtup);
+
+/* ----------
+ * toast_delete -
*
- * oldtup is NULL if insert, newtup is NULL if delete.
+ * Called by heap_delete().
* ----------
*/
-extern void heap_tuple_toast_attrs(Relation rel,
- HeapTuple newtup, HeapTuple oldtup);
+extern void toast_delete(Relation rel, HeapTuple oldtup);
/* ----------
* heap_tuple_fetch_attr() -