diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/access/heapam.h | 67 | ||||
-rw-r--r-- | src/include/access/htup.h | 6 | ||||
-rw-r--r-- | src/include/catalog/pg_attribute.h | 12 |
3 files changed, 51 insertions, 34 deletions
diff --git a/src/include/access/heapam.h b/src/include/access/heapam.h index ab30f09b308..c716ab23926 100644 --- a/src/include/access/heapam.h +++ b/src/include/access/heapam.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: heapam.h,v 1.54 2000/06/30 16:10:49 petere Exp $ + * $Id: heapam.h,v 1.55 2000/07/02 22:01:00 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -165,36 +165,41 @@ fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, * * ---------------- */ -#define heap_getattr(tup, attnum, tupleDesc, isnull) \ -( \ - AssertMacro((tup) != NULL && \ - (attnum) > FirstLowInvalidHeapAttributeNumber && \ - (attnum) != 0), \ - ((attnum) > (int) (tup)->t_data->t_natts) ? \ - ( \ - ((isnull) ? (*(isnull) = true) : (dummyret)NULL), \ - (Datum)NULL \ - ) \ - : \ - ( \ - ((attnum) > 0) ? \ - ( \ - fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \ - ) \ - : \ - ( \ - ((isnull) ? (*(isnull) = false) : (dummyret)NULL), \ - ((attnum) == SelfItemPointerAttributeNumber) ? \ - ( \ - (Datum)((char *)&((tup)->t_self)) \ - ) \ - : \ - ( \ - (Datum)*(unsigned int *) \ - ((char *)(tup)->t_data + heap_sysoffset[-(attnum)-1]) \ - ) \ - ) \ - ) \ +#define heap_getattr(tup, attnum, tupleDesc, isnull) \ +( \ + AssertMacro((tup) != NULL && \ + (attnum) > FirstLowInvalidHeapAttributeNumber && \ + (attnum) != 0), \ + ((attnum) > (int) (tup)->t_data->t_natts) ? \ + ( \ + ((isnull) ? (*(isnull) = true) : (dummyret)NULL), \ + (Datum)NULL \ + ) \ + : \ + ( \ + ((attnum) > 0) ? \ + ( \ + fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \ + ) \ + : \ + ( \ + ((isnull) ? (*(isnull) = false) : (dummyret)NULL), \ + ((attnum) == SelfItemPointerAttributeNumber) ? \ + ( \ + (Datum)((char *)&((tup)->t_self)) \ + ) \ + : \ + (((attnum) == TableOidAttributeNumber) ? \ + ( \ + (Datum)((tup)->tableOid) \ + ) \ + : \ + ( \ + (Datum)*(unsigned int *) \ + ((char *)(tup)->t_data + heap_sysoffset[-(attnum)-1]) \ + )) \ + ) \ + ) \ ) extern HeapAccessStatistics heap_access_stats; /* in stats.c */ diff --git a/src/include/access/htup.h b/src/include/access/htup.h index ff514092160..3370960e2fd 100644 --- a/src/include/access/htup.h +++ b/src/include/access/htup.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: htup.h,v 1.30 2000/06/02 10:20:26 vadim Exp $ + * $Id: htup.h,v 1.31 2000/07/02 22:01:00 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -133,7 +133,8 @@ typedef struct xl_heap_move #define MinCommandIdAttributeNumber (-4) #define MaxTransactionIdAttributeNumber (-5) #define MaxCommandIdAttributeNumber (-6) -#define FirstLowInvalidHeapAttributeNumber (-7) +#define TableOidAttributeNumber (-7) +#define FirstLowInvalidHeapAttributeNumber (-8) /* If you make any changes above, the order off offsets in this must change */ extern long heap_sysoffset[]; @@ -156,6 +157,7 @@ typedef struct HeapTupleData { uint32 t_len; /* length of *t_data */ ItemPointerData t_self; /* SelfItemPointer */ + Oid tableOid; /* */ MemoryContext t_datamcxt; /* */ HeapTupleHeader t_data; /* */ } HeapTupleData; diff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_attribute.h index a653c42a070..899b2496420 100644 --- a/src/include/catalog/pg_attribute.h +++ b/src/include/catalog/pg_attribute.h @@ -8,7 +8,7 @@ * Portions Copyright (c) 1996-2000, PostgreSQL, Inc * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: pg_attribute.h,v 1.59 2000/06/12 03:40:52 momjian Exp $ + * $Id: pg_attribute.h,v 1.60 2000/07/02 22:01:08 momjian Exp $ * * NOTES * the genbki.sh script reads this file and generates .bki @@ -267,6 +267,7 @@ DATA(insert OID = 0 ( 1247 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1247 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1247 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1247 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); +DATA(insert OID = 0 ( 1247 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); /* ---------------- * pg_database @@ -282,6 +283,7 @@ DATA(insert OID = 0 ( 1262 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1262 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1262 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1262 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); +DATA(insert OID = 0 ( 1262 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); /* ---------------- * pg_proc @@ -329,6 +331,7 @@ DATA(insert OID = 0 ( 1255 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1255 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1255 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1255 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); +DATA(insert OID = 0 ( 1255 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); /* ---------------- * pg_shadow @@ -348,6 +351,7 @@ DATA(insert OID = 0 ( 1260 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1260 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1260 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1260 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); +DATA(insert OID = 0 ( 1260 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); /* ---------------- * pg_group @@ -362,6 +366,7 @@ DATA(insert OID = 0 ( 1261 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1261 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1261 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1261 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); +DATA(insert OID = 0 ( 1261 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); /* ---------------- * pg_attribute @@ -405,6 +410,7 @@ DATA(insert OID = 0 ( 1249 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1249 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1249 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1249 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); +DATA(insert OID = 0 ( 1249 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); /* ---------------- * pg_class @@ -458,6 +464,7 @@ DATA(insert OID = 0 ( 1259 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1259 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1259 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1259 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); +DATA(insert OID = 0 ( 1259 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); /* ---------------- * pg_attrdef @@ -473,6 +480,7 @@ DATA(insert OID = 0 ( 1215 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1215 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1215 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1215 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); +DATA(insert OID = 0 ( 1215 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); /* ---------------- * pg_relcheck @@ -488,6 +496,7 @@ DATA(insert OID = 0 ( 1216 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1216 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1216 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1216 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); +DATA(insert OID = 0 ( 1216 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); /* ---------------- * pg_trigger @@ -513,6 +522,7 @@ DATA(insert OID = 0 ( 1219 xmin 28 0 4 -3 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1219 cmin 29 0 4 -4 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1219 xmax 28 0 4 -5 0 -1 -1 t p f i f f)); DATA(insert OID = 0 ( 1219 cmax 29 0 4 -6 0 -1 -1 t p f i f f)); +DATA(insert OID = 0 ( 1219 tableoid 26 0 4 -7 0 -1 -1 t p f i f f)); /* ---------------- * pg_variable - this relation is modified by special purpose access |