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.c58
1 files changed, 3 insertions, 55 deletions
diff --git a/src/backend/access/common/heaptuple.c b/src/backend/access/common/heaptuple.c
index edd90c8a56f..70e8fd948dd 100644
--- a/src/backend/access/common/heaptuple.c
+++ b/src/backend/access/common/heaptuple.c
@@ -16,7 +16,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.108 2006/07/02 02:23:18 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/access/common/heaptuple.c,v 1.109 2006/07/03 22:45:36 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1694,9 +1694,8 @@ minimal_tuple_from_heap_tuple(HeapTuple htup)
* 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. It is used in some places for
- * pg_class, but that is a gross hack (it only works because relacl can
- * be omitted from the tuple entirely in those places).
+ * known to be fixed-width and null-free. Currently it is only used for
+ * pg_attribute tuples.
* ----------------
*/
HeapTuple
@@ -1738,54 +1737,3 @@ heap_addheader(int natts, /* max domain index */
return tuple;
}
-
-/*
- * build_class_tuple
- *
- * XXX Natts_pg_class_fixed is a hack - see pg_class.h
- */
-HeapTuple
-build_class_tuple(Form_pg_class pgclass, ArrayType *options)
-{
- HeapTuple tuple;
- HeapTupleHeader td;
- Form_pg_class data; /* contents of tuple */
- Size len;
- Size size;
- int hoff;
-
- /* size of pg_class tuple with options */
- if (options)
- size = offsetof(FormData_pg_class, reloptions) + VARATT_SIZE(options);
- else
- size = CLASS_TUPLE_SIZE;
-
- /* header needs no null bitmap */
- hoff = offsetof(HeapTupleHeaderData, t_bits);
- hoff += sizeof(Oid);
- hoff = MAXALIGN(hoff);
- len = hoff + size;
-
- 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 */
-
- td->t_natts = Natts_pg_class_fixed;
- td->t_hoff = hoff;
- td->t_infomask = HEAP_HASOID;
-
- data = (Form_pg_class) ((char *) td + hoff);
- memcpy(data, pgclass, CLASS_TUPLE_SIZE);
- if (options)
- {
- td->t_natts++;
- memcpy(data->reloptions, options, VARATT_SIZE(options));
- }
-
- return tuple;
-}