aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-11-20 18:38:42 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-11-20 18:38:42 +0000
commitc8de36352fe72ae2265eb53a6e1bf334e4f24888 (patch)
treeba20f28246ebd1455098bddcfad96cc906f9021c /src/include
parentefd2ae8f19c874137c209f7a3b549d47edb387c0 (diff)
downloadpostgresql-c8de36352fe72ae2265eb53a6e1bf334e4f24888.tar.gz
postgresql-c8de36352fe72ae2265eb53a6e1bf334e4f24888.zip
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 b45df277b1e..d45ff3ac42a 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.23.2.1 2005/11/20 18:38:42 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() -