postgresql/src/backend/access/common/heaptuple.c

868 lines
19 KiB
C
Raw Normal View History

/*-------------------------------------------------------------------------
*
* heaptuple.c
* This file contains heap tuple accessor and mutator routines, as well
* as a few various tuple utilities.
*
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/heaptuple.c,v 1.65 2000/07/04 02:40:56 tgl Exp $
*
* NOTES
* The old interface functions have been converted to macros
* and moved to heapam.h
*
*-------------------------------------------------------------------------
*/
#include "postgres.h"
#include "access/heapam.h"
#include "catalog/pg_type.h"
/* Used by heap_getattr() macro, for speed */
long heap_sysoffset[] = {
/* Only the first one is pass-by-ref, and is handled specially in the macro */
1998-11-27 20:52:36 +01:00
offsetof(HeapTupleHeaderData, t_ctid),
offsetof(HeapTupleHeaderData, t_oid),
offsetof(HeapTupleHeaderData, t_xmin),
offsetof(HeapTupleHeaderData, t_cmin),
offsetof(HeapTupleHeaderData, t_xmax),
offsetof(HeapTupleHeaderData, t_cmax)
};
/* ----------------------------------------------------------------
* misc support routines
* ----------------------------------------------------------------
*/
/* ----------------
* ComputeDataSize
* ----------------
*/
Size
ComputeDataSize(TupleDesc tupleDesc,
1998-09-01 05:29:17 +02:00
Datum *value,
char *nulls)
{
uint32 data_length;
int i;
int numberOfAttributes = tupleDesc->natts;
1998-09-01 05:29:17 +02:00
Form_pg_attribute *att = tupleDesc->attrs;
for (data_length = 0, i = 0; i < numberOfAttributes; i++)
{
if (nulls[i] != ' ')
continue;
data_length = att_align(data_length, att[i]->attlen, att[i]->attalign);
data_length = att_addlength(data_length, att[i]->attlen, value[i]);
}
return data_length;
}
/* ----------------
* DataFill
* ----------------
*/
void
DataFill(char *data,
TupleDesc tupleDesc,
1998-09-01 05:29:17 +02:00
Datum *value,
char *nulls,
1997-11-02 16:27:14 +01:00
uint16 *infomask,
bits8 *bit)
{
bits8 *bitP = 0;
int bitmask = 0;
uint32 data_length;
int i;
int numberOfAttributes = tupleDesc->natts;
1998-09-01 05:29:17 +02:00
Form_pg_attribute *att = tupleDesc->attrs;
if (bit != NULL)
{
bitP = &bit[-1];
bitmask = CSIGNBIT;
}
*infomask &= HEAP_XACT_MASK;
for (i = 0; i < numberOfAttributes; i++)
{
if (bit != NULL)
{
if (bitmask != CSIGNBIT)
bitmask <<= 1;
else
{
bitP += 1;
*bitP = 0x0;
bitmask = 1;
}
if (nulls[i] == 'n')
{
*infomask |= HEAP_HASNULL;
continue;
}
*bitP |= bitmask;
}
1999-05-25 18:15:34 +02:00
data = (char *) att_align((long) data, att[i]->attlen, att[i]->attalign);
switch (att[i]->attlen)
{
case -1:
*infomask |= HEAP_HASVARLENA;
if (VARATT_IS_EXTERNAL(value[i]))
*infomask |= HEAP_HASEXTERNAL;
if (VARATT_IS_COMPRESSED(value[i]))
*infomask |= HEAP_HASCOMPRESSED;
data_length = VARATT_SIZE(DatumGetPointer(value[i]));
memmove(data, DatumGetPointer(value[i]), data_length);
break;
case sizeof(char):
*data = att[i]->attbyval ?
DatumGetChar(value[i]) : *((char *) value[i]);
break;
case sizeof(int16):
*(short *) data = (att[i]->attbyval ?
DatumGetInt16(value[i]) :
*((short *) value[i]));
break;
case sizeof(int32):
*(int32 *) data = (att[i]->attbyval ?
DatumGetInt32(value[i]) :
*((int32 *) value[i]));
break;
default:
Assert(att[i]->attlen >= 0);
memmove(data, DatumGetPointer(value[i]),
(size_t) (att[i]->attlen));
break;
}
1999-05-25 18:15:34 +02:00
data = (char *) att_addlength((long) data, att[i]->attlen, value[i]);
}
}
/* ----------------------------------------------------------------
* heap tuple interface
* ----------------------------------------------------------------
*/
/* ----------------
* heap_attisnull - returns 1 iff tuple attribute is not present
* ----------------
*/
int
heap_attisnull(HeapTuple tup, int attnum)
{
1998-11-27 20:52:36 +01:00
if (attnum > (int) tup->t_data->t_natts)
1998-09-01 05:29:17 +02:00
return 1;
if (HeapTupleNoNulls(tup))
1998-09-01 05:29:17 +02:00
return 0;
if (attnum > 0)
1998-11-27 20:52:36 +01:00
return att_isnull(attnum - 1, tup->t_data->t_bits);
else
switch (attnum)
{
case TableOidAttributeNumber:
case SelfItemPointerAttributeNumber:
case ObjectIdAttributeNumber:
case MinTransactionIdAttributeNumber:
case MinCommandIdAttributeNumber:
case MaxTransactionIdAttributeNumber:
case MaxCommandIdAttributeNumber:
break;
case 0:
elog(ERROR, "heap_attisnull: zero attnum disallowed");
default:
elog(ERROR, "heap_attisnull: undefined negative attnum");
}
1998-09-01 05:29:17 +02:00
return 0;
}
/* ----------------------------------------------------------------
* system attribute heap tuple support
* ----------------------------------------------------------------
*/
/* ----------------
* heap_sysattrlen
*
* This routine returns the length of a system attribute.
* ----------------
*/
int
heap_sysattrlen(AttrNumber attno)
{
1999-05-25 18:15:34 +02:00
HeapTupleHeader f = NULL;
switch (attno)
{
case TableOidAttributeNumber:
return sizeof f->t_oid;
case SelfItemPointerAttributeNumber:
return sizeof f->t_ctid;
case ObjectIdAttributeNumber:
return sizeof f->t_oid;
case MinTransactionIdAttributeNumber:
return sizeof f->t_xmin;
case MinCommandIdAttributeNumber:
return sizeof f->t_cmin;
case MaxTransactionIdAttributeNumber:
return sizeof f->t_xmax;
case MaxCommandIdAttributeNumber:
return sizeof f->t_cmax;
default:
elog(ERROR, "sysattrlen: System attribute number %d unknown.", attno);
return 0;
}
}
/* ----------------
* heap_sysattrbyval
*
* This routine returns the "by-value" property of a system attribute.
* ----------------
*/
bool
heap_sysattrbyval(AttrNumber attno)
{
bool byval;
switch (attno)
{
case TableOidAttributeNumber:
byval = true;
break;
case SelfItemPointerAttributeNumber:
byval = false;
break;
case ObjectIdAttributeNumber:
byval = true;
break;
case MinTransactionIdAttributeNumber:
byval = true;
break;
case MinCommandIdAttributeNumber:
byval = true;
break;
case MaxTransactionIdAttributeNumber:
byval = true;
break;
case MaxCommandIdAttributeNumber:
byval = true;
break;
default:
byval = true;
elog(ERROR, "sysattrbyval: System attribute number %d unknown.",
attno);
break;
}
return byval;
}
#ifdef NOT_USED
/* ----------------
* heap_getsysattr
* ----------------
*/
Datum
heap_getsysattr(HeapTuple tup, Buffer b, int attnum)
{
switch (attnum)
{
case TableOidAttributeNumber:
return (Datum) &tup->t_tableoid;
case SelfItemPointerAttributeNumber:
1998-09-01 05:29:17 +02:00
return (Datum) &tup->t_ctid;
case ObjectIdAttributeNumber:
1998-09-01 05:29:17 +02:00
return (Datum) (long) tup->t_oid;
case MinTransactionIdAttributeNumber:
1998-09-01 05:29:17 +02:00
return (Datum) (long) tup->t_xmin;
case MinCommandIdAttributeNumber:
1998-09-01 05:29:17 +02:00
return (Datum) (long) tup->t_cmin;
case MaxTransactionIdAttributeNumber:
1998-09-01 05:29:17 +02:00
return (Datum) (long) tup->t_xmax;
case MaxCommandIdAttributeNumber:
1998-09-01 05:29:17 +02:00
return (Datum) (long) tup->t_cmax;
default:
elog(ERROR, "heap_getsysattr: undefined attnum %d", attnum);
}
1998-09-01 05:29:17 +02:00
return (Datum) NULL;
}
1999-05-25 18:15:34 +02:00
#endif
/* ----------------
* nocachegetattr
*
* This only gets called from fastgetattr() macro, in cases where
* we can't use a cacheoffset and the value is not null.
*
* This caches attribute offsets in the attribute descriptor.
*
* An alternate way to speed things up would be to cache offsets
* with the tuple, but that seems more difficult unless you take
* the storage hit of actually putting those offsets into the
* tuple you send to disk. Yuck.
*
* This scheme will be slightly slower than that, but should
* perform well for queries which hit large #'s of tuples. After
* you cache the offsets once, examining all the other tuples using
* the same attribute descriptor will go much quicker. -cim 5/4/91
* ----------------
*/
Datum
1998-11-27 20:52:36 +01:00
nocachegetattr(HeapTuple tuple,
int attnum,
TupleDesc tupleDesc,
bool *isnull)
{
1999-05-25 18:15:34 +02:00
char *tp; /* ptr to att in tuple */
HeapTupleHeader tup = tuple->t_data;
bits8 *bp = tup->t_bits; /* ptr to att in tuple */
Form_pg_attribute *att = tupleDesc->attrs;
int slow = 0; /* do we have to walk nulls? */
(void) isnull; /* not used */
#ifdef IN_MACRO
/* This is handled in the macro */
Assert(attnum > 0);
if (isnull)
*isnull = false;
#endif
attnum--;
/* ----------------
* Three cases:
*
* 1: No nulls and no variable length attributes.
* 2: Has a null or a varlena AFTER att.
* 3: Has nulls or varlenas BEFORE att.
* ----------------
*/
1998-11-27 20:52:36 +01:00
if (HeapTupleNoNulls(tuple))
{
#ifdef IN_MACRO
/* This is handled in the macro */
if (att[attnum]->attcacheoff != -1)
{
return (Datum)
fetchatt(&(att[attnum]),
(char *) tup + tup->t_hoff + att[attnum]->attcacheoff);
}
else if (attnum == 0)
{
/*
* first attribute is always at position zero
*/
1998-09-01 05:29:17 +02:00
return (Datum) fetchatt(&(att[0]), (char *) tup + tup->t_hoff);
}
#endif
}
else
{
1999-05-25 18:15:34 +02:00
/*
* there's a null somewhere in the tuple
*/
/* ----------------
* check to see if desired att is null
* ----------------
*/
#ifdef IN_MACRO
/* This is handled in the macro */
if (att_isnull(attnum, bp))
{
if (isnull)
*isnull = true;
return (Datum) NULL;
}
#endif
/* ----------------
* Now check to see if any preceding bits are null...
* ----------------
*/
{
int byte = attnum >> 3;
int finalbit = attnum & 0x07;
/* check for nulls "before" final bit of last byte */
1999-05-25 18:15:34 +02:00
if ((~bp[byte]) & ((1 << finalbit) - 1))
slow = 1;
else
{
/* check for nulls in any "earlier" bytes */
1999-05-25 18:15:34 +02:00
int i;
for (i = 0; i < byte; i++)
{
if (bp[i] != 0xFF)
{
slow = 1;
break;
}
}
}
}
}
tp = (char *) tup + tup->t_hoff;
/*
* now check for any non-fixed length attrs before our attribute
*/
if (!slow)
{
if (att[attnum]->attcacheoff != -1)
{
return (Datum) fetchatt(&(att[attnum]),
tp + att[attnum]->attcacheoff);
}
else if (attnum == 0)
return (Datum) fetchatt(&(att[0]), tp);
1998-11-27 20:52:36 +01:00
else if (!HeapTupleAllFixed(tuple))
{
int j;
1999-05-25 18:15:34 +02:00
/*
* In for(), we make this <= and not < because we want to test
* if we can go past it in initializing offsets.
*/
for (j = 0; j <= attnum; j++)
{
if (att[j]->attlen < 1 && !VARLENA_FIXED_SIZE(att[j]))
{
slow = 1;
break;
}
}
}
}
/*
* If slow is zero, and we got here, we know that we have a tuple with
1999-05-25 18:15:34 +02:00
* no nulls or varlenas before the target attribute. If possible, we
* also want to initialize the remainder of the attribute cached
* offset values.
*/
if (!slow)
{
int j = 1;
long off;
/*
* need to set cache for some atts
*/
att[0]->attcacheoff = 0;
while (att[j]->attcacheoff > 0)
j++;
if (!VARLENA_FIXED_SIZE(att[j - 1]))
off = att[j - 1]->attcacheoff + att[j - 1]->attlen;
else
off = att[j - 1]->attcacheoff + att[j - 1]->atttypmod;
for (; j <= attnum ||
/* Can we compute more? We will probably need them */
(j < tup->t_natts &&
att[j]->attcacheoff == -1 &&
1998-11-27 20:52:36 +01:00
(HeapTupleNoNulls(tuple) || !att_isnull(j, bp)) &&
(HeapTupleAllFixed(tuple) ||
att[j]->attlen > 0 || VARLENA_FIXED_SIZE(att[j]))); j++)
{
/*
* Fix me when going to a machine with more than a four-byte
* word!
*/
off = att_align(off, att[j]->attlen, att[j]->attalign);
att[j]->attcacheoff = off;
off = att_addlength(off, att[j]->attlen, tp + off);
}
return (Datum) fetchatt(&(att[attnum]), tp + att[attnum]->attcacheoff);
}
else
{
bool usecache = true;
int off = 0;
int i;
/*
* Now we know that we have to walk the tuple CAREFULLY.
*
* Note - This loop is a little tricky. On iteration i we first set
* the offset for attribute i and figure out how much the offset
* should be incremented. Finally, we need to align the offset
* based on the size of attribute i+1 (for which the offset has
* been computed). -mer 12 Dec 1991
*/
for (i = 0; i < attnum; i++)
{
1998-11-27 20:52:36 +01:00
if (!HeapTupleNoNulls(tuple))
{
if (att_isnull(i, bp))
{
usecache = false;
continue;
}
}
/* If we know the next offset, we can skip the rest */
if (usecache && att[i]->attcacheoff != -1)
off = att[i]->attcacheoff;
else
{
off = att_align(off, att[i]->attlen, att[i]->attalign);
if (usecache)
att[i]->attcacheoff = off;
}
off = att_addlength(off, att[i]->attlen, tp + off);
if (usecache &&
att[i]->attlen == -1 && !VARLENA_FIXED_SIZE(att[i]))
usecache = false;
}
off = att_align(off, att[attnum]->attlen, att[attnum]->attalign);
return (Datum) fetchatt(&(att[attnum]), tp + off);
}
}
/* ----------------
* heap_copytuple
*
* returns a copy of an entire tuple
* ----------------
*/
HeapTuple
heap_copytuple(HeapTuple tuple)
{
HeapTuple newTuple;
1998-11-27 20:52:36 +01:00
if (!HeapTupleIsValid(tuple) || tuple->t_data == NULL)
1998-09-01 05:29:17 +02:00
return NULL;
1998-11-27 20:52:36 +01:00
newTuple = (HeapTuple) palloc(HEAPTUPLESIZE + tuple->t_len);
newTuple->t_len = tuple->t_len;
newTuple->t_self = tuple->t_self;
newTuple->t_datamcxt = CurrentMemoryContext;
1998-11-27 20:52:36 +01:00
newTuple->t_data = (HeapTupleHeader) ((char *) newTuple + HEAPTUPLESIZE);
1999-05-25 18:15:34 +02:00
memmove((char *) newTuple->t_data,
(char *) tuple->t_data, tuple->t_len);
1998-09-01 05:29:17 +02:00
return newTuple;
}
1998-11-27 20:52:36 +01:00
/* ----------------
* heap_copytuple_with_tuple
*
* returns a copy of an tuple->t_data
* ----------------
*/
void
heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest)
{
if (!HeapTupleIsValid(src) || src->t_data == NULL)
{
dest->t_data = NULL;
return;
}
1999-05-25 18:15:34 +02:00
1998-11-27 20:52:36 +01:00
dest->t_len = src->t_len;
dest->t_self = src->t_self;
dest->t_datamcxt = CurrentMemoryContext;
1998-11-27 20:52:36 +01:00
dest->t_data = (HeapTupleHeader) palloc(src->t_len);
1999-05-25 18:15:34 +02:00
memmove((char *) dest->t_data,
(char *) src->t_data, src->t_len);
1998-11-27 20:52:36 +01:00
return;
}
#ifdef NOT_USED
/* ----------------
* heap_deformtuple
*
* the inverse of heap_formtuple (see below)
* ----------------
*/
void
heap_deformtuple(HeapTuple tuple,
TupleDesc tdesc,
1998-09-01 05:29:17 +02:00
Datum *values,
char *nulls)
{
int i;
int natts;
Assert(HeapTupleIsValid(tuple));
natts = tuple->t_natts;
for (i = 0; i < natts; i++)
{
bool isnull;
values[i] = heap_getattr(tuple,
i + 1,
tdesc,
&isnull);
if (isnull)
nulls[i] = 'n';
else
nulls[i] = ' ';
}
}
#endif
/* ----------------
* heap_formtuple
*
1998-09-01 05:29:17 +02:00
* constructs a tuple from the given *value and *null arrays
*
* old comments
* Handles alignment by aligning 2 byte attributes on short boundries
* and 3 or 4 byte attributes on long word boundries on a vax; and
* aligning non-byte attributes on short boundries on a sun. Does
* not properly align fixed length arrays of 1 or 2 byte types (yet).
*
* Null attributes are indicated by a 'n' in the appropriate byte
1998-09-01 05:29:17 +02:00
* of the *null. Non-null attributes are indicated by a ' ' (space).
*
* Fix me. (Figure that must keep context if debug--allow give oid.)
* Assumes in order.
* ----------------
*/
HeapTuple
heap_formtuple(TupleDesc tupleDescriptor,
1998-09-01 05:29:17 +02:00
Datum *value,
char *nulls)
{
1999-05-25 18:15:34 +02:00
HeapTuple tuple; /* return tuple */
HeapTupleHeader td; /* tuple data */
int bitmaplen;
unsigned long len;
1999-05-25 18:15:34 +02:00
int hoff;
bool hasnull = false;
int i;
int numberOfAttributes = tupleDescriptor->natts;
1998-11-27 20:52:36 +01:00
len = offsetof(HeapTupleHeaderData, t_bits);
for (i = 0; i < numberOfAttributes && !hasnull; i++)
{
if (nulls[i] != ' ')
hasnull = true;
}
if (numberOfAttributes > MaxHeapAttributeNumber)
elog(ERROR, "heap_formtuple: numberOfAttributes of %d > %d",
numberOfAttributes, MaxHeapAttributeNumber);
if (hasnull)
{
bitmaplen = BITMAPLEN(numberOfAttributes);
len += bitmaplen;
}
hoff = len = MAXALIGN(len); /* be conservative here */
len += ComputeDataSize(tupleDescriptor, value, nulls);
1998-11-27 20:52:36 +01:00
tuple = (HeapTuple) palloc(HEAPTUPLESIZE + len);
tuple->t_datamcxt = CurrentMemoryContext;
1999-03-14 21:17:20 +01:00
td = tuple->t_data = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE);
MemSet((char *) td, 0, len);
tuple->t_len = len;
1998-11-27 20:52:36 +01:00
ItemPointerSetInvalid(&(tuple->t_self));
td->t_natts = numberOfAttributes;
td->t_hoff = hoff;
1998-11-27 20:52:36 +01:00
DataFill((char *) td + td->t_hoff,
tupleDescriptor,
value,
nulls,
1998-11-27 20:52:36 +01:00
&td->t_infomask,
(hasnull ? td->t_bits : NULL));
1998-11-27 20:52:36 +01:00
td->t_infomask |= HEAP_XMAX_INVALID;
1997-11-02 16:27:14 +01:00
1998-09-01 05:29:17 +02:00
return tuple;
}
/* ----------------
* heap_modifytuple
*
* forms a new tuple from an old tuple and a set of replacement values.
* returns a new palloc'ed tuple.
* ----------------
*/
HeapTuple
heap_modifytuple(HeapTuple tuple,
Relation relation,
1998-09-01 05:29:17 +02:00
Datum *replValue,
char *replNull,
char *repl)
{
int attoff;
int numberOfAttributes;
Datum *value;
char *nulls;
bool isNull;
HeapTuple newTuple;
uint8 infomask;
/* ----------------
* sanity checks
* ----------------
*/
Assert(HeapTupleIsValid(tuple));
Assert(RelationIsValid(relation));
Assert(PointerIsValid(replValue));
Assert(PointerIsValid(replNull));
Assert(PointerIsValid(repl));
1998-09-01 05:29:17 +02:00
numberOfAttributes = RelationGetForm(relation)->relnatts;
/* ----------------
1998-09-01 05:29:17 +02:00
* allocate and fill *value and *nulls arrays from either
* the tuple or the repl information, as appropriate.
* ----------------
*/
value = (Datum *) palloc(numberOfAttributes * sizeof *value);
nulls = (char *) palloc(numberOfAttributes * sizeof *nulls);
for (attoff = 0;
attoff < numberOfAttributes;
attoff += 1)
{
if (repl[attoff] == ' ')
{
value[attoff] = heap_getattr(tuple,
1999-05-25 18:15:34 +02:00
AttrOffsetGetAttrNumber(attoff),
RelationGetDescr(relation),
&isNull);
nulls[attoff] = (isNull) ? 'n' : ' ';
}
else if (repl[attoff] != 'r')
elog(ERROR, "heap_modifytuple: repl is \\%3d", repl[attoff]);
else
{ /* == 'r' */
value[attoff] = replValue[attoff];
nulls[attoff] = replNull[attoff];
}
}
/* ----------------
1998-09-01 05:29:17 +02:00
* create a new tuple from the *values and *nulls arrays
* ----------------
*/
1998-09-01 05:29:17 +02:00
newTuple = heap_formtuple(RelationGetDescr(relation),
value,
nulls);
/* ----------------
* copy the header except for t_len, t_natts, t_hoff, t_bits, t_infomask
* ----------------
*/
1998-11-27 20:52:36 +01:00
infomask = newTuple->t_data->t_infomask;
memmove((char *) &newTuple->t_data->t_oid, /* XXX */
(char *) &tuple->t_data->t_oid,
1999-05-25 18:15:34 +02:00
((char *) &tuple->t_data->t_hoff -
(char *) &tuple->t_data->t_oid)); /* XXX */
1998-11-27 20:52:36 +01:00
newTuple->t_data->t_infomask = infomask;
newTuple->t_data->t_natts = numberOfAttributes;
newTuple->t_self = tuple->t_self;
1999-05-25 18:15:34 +02:00
return newTuple;
}
/* ----------------
* heap_freetuple
* ----------------
*/
void
heap_freetuple(HeapTuple htup)
{
if (htup->t_data != NULL)
if (htup->t_datamcxt != NULL && (char *) (htup->t_data) !=
((char *) htup + HEAPTUPLESIZE))
pfree(htup->t_data);
pfree(htup);
}
/* ----------------------------------------------------------------
* other misc functions
* ----------------------------------------------------------------
*/
HeapTuple
heap_addheader(uint32 natts, /* max domain index */
int structlen, /* its length */
char *structure) /* pointer to the struct */
{
1999-05-25 18:15:34 +02:00
HeapTuple tuple;
HeapTupleHeader td; /* tuple data */
unsigned long len;
1999-05-25 18:15:34 +02:00
int hoff;
AssertArg(natts > 0);
1998-11-27 20:52:36 +01:00
len = offsetof(HeapTupleHeaderData, t_bits);
hoff = len = MAXALIGN(len); /* be conservative */
len += structlen;
1998-11-27 20:52:36 +01:00
tuple = (HeapTuple) palloc(HEAPTUPLESIZE + len);
tuple->t_datamcxt = CurrentMemoryContext;
1998-11-27 20:52:36 +01:00
td = tuple->t_data = (HeapTupleHeader) ((char *) tuple + HEAPTUPLESIZE);
MemSet((char *) td, 0, len);
1998-11-27 20:52:36 +01:00
tuple->t_len = len;
ItemPointerSetInvalid(&(tuple->t_self));
td->t_hoff = hoff;
td->t_natts = natts;
td->t_infomask = 0;
td->t_infomask |= HEAP_XMAX_INVALID;
if (structlen > 0)
memmove((char *) td + hoff, structure, (size_t) structlen);
1998-11-27 20:52:36 +01:00
return tuple;
}