diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-09-02 01:05:06 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-09-02 01:05:06 +0000 |
| commit | c7a165adc64e3e67e0dcee4088d84a0638b3515a (patch) | |
| tree | 97d02a63e6ab6a516cb8e8ba24b0ba42782d202d /src/include/access/tupdesc.h | |
| parent | fcd34f9f7ff561213beef97f93c32f415e35a79c (diff) | |
| download | postgresql-c7a165adc64e3e67e0dcee4088d84a0638b3515a.tar.gz | |
Code review for HeapTupleHeader changes. Add version number to page headers
(overlaying low byte of page size) and add HEAP_HASOID bit to t_infomask,
per earlier discussion. Simplify scheme for overlaying fields in tuple
header (no need for cmax to live in more than one place). Don't try to
clear infomask status bits in tqual.c --- not safe to do it there. Don't
try to force output table of a SELECT INTO to have OIDs, either. Get rid
of unnecessarily complex three-state scheme for TupleDesc.tdhasoids, which
has already caused one recent failure. Improve documentation.
Diffstat (limited to 'src/include/access/tupdesc.h')
| -rw-r--r-- | src/include/access/tupdesc.h | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src/include/access/tupdesc.h b/src/include/access/tupdesc.h index c8c9839985..09512a322e 100644 --- a/src/include/access/tupdesc.h +++ b/src/include/access/tupdesc.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: tupdesc.h,v 1.37 2002/07/20 05:16:59 momjian Exp $ + * $Id: tupdesc.h,v 1.38 2002/09/02 01:05:06 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -41,14 +41,9 @@ typedef struct tupleConstr bool has_not_null; } TupleConstr; -typedef char hasoid_t; -#define WITHOID 'C' -#define WITHOUTOID 'S' -#define UNDEFOID '?' -#define BoolToHasOid(b) ((b) ? WITHOID : WITHOUTOID) /* * This structure contains all information (i.e. from Classes - * pg_attribute, pg_attrdef, pg_constraint) for a tuple. + * pg_attribute, pg_attrdef, pg_constraint) for the structure of a tuple. */ typedef struct tupleDesc { @@ -56,29 +51,14 @@ typedef struct tupleDesc Form_pg_attribute *attrs; /* attrs[N] is a pointer to the description of Attribute Number N+1. */ TupleConstr *constr; - hasoid_t tdhasoid; /* Tuple has an oid attribute in its header */ + bool tdhasoid; /* Tuple has oid attribute in its header */ } *TupleDesc; -#ifdef DEBUG_TUPLE_ACCESS -#define AssertTupleDescHasOidIsValid(td) \ - Assert(((td)->tdhasoid == WITHOID) || ((td)->tdhasoid == WITHOUTOID)) -#define AssertTupleDescHasOid(td) \ - Assert((td)->tdhasoid == WITHOID) -#define AssertTupleDescHasNoOid(td) \ - Assert((td)->tdhasoid == WITHOUTOID) +extern TupleDesc CreateTemplateTupleDesc(int natts, bool hasoid); -#else - -#define AssertTupleDescHasOidIsValid(td) -#define AssertTupleDescHasOid(td) -#define AssertTupleDescHasNoOid(td) - -#endif - -extern TupleDesc CreateTemplateTupleDesc(int natts, hasoid_t withoid); - -extern TupleDesc CreateTupleDesc(int natts, Form_pg_attribute *attrs); +extern TupleDesc CreateTupleDesc(int natts, bool hasoid, + Form_pg_attribute *attrs); extern TupleDesc CreateTupleDescCopy(TupleDesc tupdesc); |
