aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/common/heaptuple.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/common/heaptuple.c')
-rw-r--r--src/backend/access/common/heaptuple.c55
1 files changed, 1 insertions, 54 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index 201a3878bc6..d4e33f1c3de 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -50,7 +50,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.123 2008/11/02 01:45:26 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.124 2008/11/14 01:57:41 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1576,56 +1576,3 @@ minimal_tuple_from_heap_tuple(HeapTuple htup)
result->t_len = len;
return result;
}
-
-
-/* ----------------
- * heap_addheader
- *
- * This routine forms a HeapTuple by copying the given structure (tuple
- * data) and adding a generic header. Note that the tuple data is
- * presumed to contain no null fields and no varlena fields.
- *
- * This routine is really only useful for certain system tables that are
- * known to be fixed-width and null-free. Currently it is only used for
- * pg_attribute tuples.
- * ----------------
- */
-HeapTuple
-heap_addheader(int natts, /* max domain index */
- bool withoid, /* reserve space for oid */
- Size structlen, /* its length */
- void *structure) /* pointer to the struct */
-{
- HeapTuple tuple;
- HeapTupleHeader td;
- Size len;
- int hoff;
-
- AssertArg(natts > 0);
-
- /* header needs no null bitmap */
- hoff = offsetof(HeapTupleHeaderData, t_bits);
- if (withoid)
- hoff += sizeof(Oid);
- hoff = MAXALIGN(hoff);
- len = hoff + structlen;
-
- tuple = (HeapTuple) palloc0(HEAPTUPLESIZE + len);
- tuple->t_data = td = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE);
-
- tuple->t_len = len;
- ItemPointerSetInvalid(&(tuple->t_self));
- tuple->t_tableOid = InvalidOid;
-
- /* we don't bother to fill the Datum fields */
-
- HeapTupleHeaderSetNatts(td, natts);
- td->t_hoff = hoff;
-
- if (withoid) /* else leave infomask = 0 */
- td->t_infomask = HEAP_HASOID;
-
- memcpy((char *) td + hoff, structure, structlen);
-
- return tuple;
-}