Commit 7c385f73 authored by Jan Wieck's avatar Jan Wieck

Required catalog changes for extended LONG attribute storage.

Jan
parent 665db209
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.57 1999/11/22 17:55:52 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/access/common/tupdesc.c,v 1.58 1999/12/20 10:40:38 wieck Exp $
*
* NOTES
* some of the executor utility code such as "ExecTypeFromTL" should be
......@@ -322,6 +322,7 @@ TupleDescInitEntry(TupleDesc desc,
att->atttypid = InvalidOid;
att->attlen = (int16) 0;
att->attbyval = (bool) 0;
att->attstorage = 'p';
att->attalign = 'i';
return false;
}
......@@ -366,11 +367,22 @@ TupleDescInitEntry(TupleDesc desc,
att->attlen = typeLen(t);
att->attbyval = typeByVal(t);
att->attstorage = 'p';
}
else
{
att->attlen = typeForm->typlen;
att->attbyval = typeForm->typbyval;
/*
* This will enable ALL variable size attributes of user
* relations for automatic move off into "secondary" relation.
* Jan
*/
#ifdef LONG_ATTRIBUTES_NOW_IMPLEMENTED_FOR_ALL_VARLENA_DATA_TYPES
att->attcanlong = (att->attlen == -1) ? 'e' : 'p';
#else
att->attstorage = 'p';
#endif
}
......@@ -401,6 +413,7 @@ TupleDescMakeSelfReference(TupleDesc desc,
att->atttypid = TypeShellMake(relname);
att->attlen = typeLen(t);
att->attbyval = typeByVal(t);
att->attstorage = 'p';
att->attnelems = 0;
}
......
......@@ -7,7 +7,7 @@
* Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.73 1999/12/16 22:19:37 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootstrap.c,v 1.74 1999/12/20 10:40:39 wieck Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -562,6 +562,7 @@ DefineAttr(char *name, char *type, int attnum)
attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */
attlen = attrtypes[attnum]->attlen = Ap->am_typ.typlen;
attrtypes[attnum]->attbyval = Ap->am_typ.typbyval;
attrtypes[attnum]->attstorage = 'p';
attrtypes[attnum]->attalign = Ap->am_typ.typalign;
}
else
......@@ -572,6 +573,7 @@ DefineAttr(char *name, char *type, int attnum)
printf("<%s %s> ", NameStr(attrtypes[attnum]->attname), type);
attrtypes[attnum]->attnum = 1 + attnum; /* fillatt */
attlen = attrtypes[attnum]->attlen = Procid[typeoid].len;
attrtypes[attnum]->attstorage = 'p';
/*
* Cheat like mad to fill in these items from the length only.
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.113 1999/12/16 22:19:38 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.114 1999/12/20 10:40:40 wieck Exp $
*
*
* INTERFACE ROUTINES
......@@ -105,32 +105,32 @@ static void RemoveStatistics(Relation rel);
static FormData_pg_attribute a1 = {
0xffffffff, {"ctid"}, TIDOID, 0, sizeof(ItemPointerData),
SelfItemPointerAttributeNumber, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'
SelfItemPointerAttributeNumber, 0, -1, -1, '\0', 'p', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a2 = {
0xffffffff, {"oid"}, OIDOID, 0, sizeof(Oid),
ObjectIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
ObjectIdAttributeNumber, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a3 = {
0xffffffff, {"xmin"}, XIDOID, 0, sizeof(TransactionId),
MinTransactionIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
MinTransactionIdAttributeNumber, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a4 = {
0xffffffff, {"cmin"}, CIDOID, 0, sizeof(CommandId),
MinCommandIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
MinCommandIdAttributeNumber, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a5 = {
0xffffffff, {"xmax"}, XIDOID, 0, sizeof(TransactionId),
MaxTransactionIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
MaxTransactionIdAttributeNumber, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0'
};
static FormData_pg_attribute a6 = {
0xffffffff, {"cmax"}, CIDOID, 0, sizeof(CommandId),
MaxCommandIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
MaxCommandIdAttributeNumber, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0'
};
static Form_pg_attribute HeapAtt[] = {&a1, &a2, &a3, &a4, &a5, &a6};
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.100 1999/12/16 22:19:39 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.101 1999/12/20 10:40:40 wieck Exp $
*
*
* INTERFACE ROUTINES
......@@ -99,12 +99,12 @@ static Oid IndexGetRelation(Oid indexId);
* ----------------------------------------------------------------
*/
static FormData_pg_attribute sysatts[] = {
{0, {"ctid"}, TIDOID, 0, 6, -1, 0, -1, -1, '\0', '\0', 'i', '\0', '\0'},
{0, {"oid"}, OIDOID, 0, 4, -2, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'},
{0, {"xmin"}, XIDOID, 0, 4, -3, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'},
{0, {"cmin"}, CIDOID, 0, 4, -4, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'},
{0, {"xmax"}, XIDOID, 0, 4, -5, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'},
{0, {"cmax"}, CIDOID, 0, 4, -6, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'},
{0, {"ctid"}, TIDOID, 0, 6, -1, 0, -1, -1, '\0', 'p', '\0', 'i', '\0', '\0'},
{0, {"oid"}, OIDOID, 0, 4, -2, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0'},
{0, {"xmin"}, XIDOID, 0, 4, -3, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0'},
{0, {"cmin"}, CIDOID, 0, 4, -4, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0'},
{0, {"xmax"}, XIDOID, 0, 4, -5, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0'},
{0, {"cmax"}, CIDOID, 0, 4, -6, 0, -1, -1, '\001', 'p', '\0', 'i', '\0', '\0'},
};
/* ----------------------------------------------------------------
......@@ -186,6 +186,7 @@ BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
funcTupDesc->attrs[0]->attbyval = ((Form_pg_type) GETSTRUCT(tuple))->typbyval;
funcTupDesc->attrs[0]->attcacheoff = -1;
funcTupDesc->attrs[0]->atttypmod = -1;
funcTupDesc->attrs[0]->attstorage = 'p';
funcTupDesc->attrs[0]->attalign = ((Form_pg_type) GETSTRUCT(tuple))->typalign;
/*
......@@ -328,6 +329,7 @@ ConstructTupleDescriptor(Oid heapoid,
((Form_pg_type) GETSTRUCT(tup))->typbyval;
((Form_pg_attribute) to)->attlen =
((Form_pg_type) GETSTRUCT(tup))->typlen;
((Form_pg_attribute) to)->attstorage = 'p';
((Form_pg_attribute) to)->attalign =
((Form_pg_type) GETSTRUCT(tup))->typalign;
((Form_pg_attribute) to)->atttypmod = IndexKeyType->typmod;
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.61 1999/12/16 22:19:41 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.62 1999/12/20 10:40:41 wieck Exp $
*
* NOTES
* The PortalExecutorHeapMemory crap needs to be eliminated
......@@ -455,6 +455,7 @@ PerformAddAttribute(char *relationName,
attribute->attbyval = tform->typbyval;
attribute->attnelems = attnelems;
attribute->attisset = (bool) (tform->typtype == 'c');
attribute->attstorage = 'p';
attribute->attalign = tform->typalign;
attribute->attnotnull = false;
attribute->atthasdef = (colDef->raw_default != NULL ||
......
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.50 1999/11/07 23:08:06 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/execUtils.c,v 1.51 1999/12/20 10:40:42 wieck Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -564,6 +564,7 @@ ExecSetTypeInfo(int index,
att->attcacheoff = -1;
att->atttypmod = -1;
att->attisset = false;
att->attstorage = 'p';
att->attalign = attalign;
}
......
This diff is collapsed.
......@@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_class.h,v 1.31 1999/12/16 17:24:17 momjian Exp $
* $Id: pg_class.h,v 1.32 1999/12/20 10:40:43 wieck Exp $
*
* NOTES
* ``pg_relation'' is being replaced by ``pg_class''. currently
......@@ -58,6 +58,7 @@ CATALOG(pg_class) BOOTSTRAP
Oid relam;
int4 relpages;
int4 reltuples;
Oid rellongrelid;
bool relhasindex;
bool relisshared;
char relkind;
......@@ -100,57 +101,58 @@ typedef FormData_pg_class *Form_pg_class;
* relacl field.
* ----------------
*/
#define Natts_pg_class_fixed 17
#define Natts_pg_class 18
#define Natts_pg_class_fixed 18
#define Natts_pg_class 19
#define Anum_pg_class_relname 1
#define Anum_pg_class_reltype 2
#define Anum_pg_class_relowner 3
#define Anum_pg_class_relam 4
#define Anum_pg_class_relpages 5
#define Anum_pg_class_reltuples 6
#define Anum_pg_class_relhasindex 7
#define Anum_pg_class_relisshared 8
#define Anum_pg_class_relkind 9
#define Anum_pg_class_relnatts 10
#define Anum_pg_class_relchecks 11
#define Anum_pg_class_reltriggers 12
#define Anum_pg_class_relukeys 13
#define Anum_pg_class_relfkeys 14
#define Anum_pg_class_relrefs 15
#define Anum_pg_class_relhaspkey 16
#define Anum_pg_class_relhasrules 17
#define Anum_pg_class_relacl 18
#define Anum_pg_class_rellongrelid 7
#define Anum_pg_class_relhasindex 8
#define Anum_pg_class_relisshared 9
#define Anum_pg_class_relkind 10
#define Anum_pg_class_relnatts 11
#define Anum_pg_class_relchecks 12
#define Anum_pg_class_reltriggers 13
#define Anum_pg_class_relukeys 14
#define Anum_pg_class_relfkeys 15
#define Anum_pg_class_relrefs 16
#define Anum_pg_class_relhaspkey 17
#define Anum_pg_class_relhasrules 18
#define Anum_pg_class_relacl 19
/* ----------------
* initial contents of pg_class
* ----------------
*/
DATA(insert OID = 1247 ( pg_type 71 PGUID 0 0 0 f f r 16 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1247 ( pg_type 71 PGUID 0 0 0 0 f f r 16 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 1249 ( pg_attribute 75 PGUID 0 0 0 f f r 14 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1249 ( pg_attribute 75 PGUID 0 0 0 0 f f r 15 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 1255 ( pg_proc 81 PGUID 0 0 0 f f r 16 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1255 ( pg_proc 81 PGUID 0 0 0 0 f f r 16 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 1259 ( pg_class 83 PGUID 0 0 0 f f r 18 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1259 ( pg_class 83 PGUID 0 0 0 0 f f r 19 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 1260 ( pg_shadow 86 PGUID 0 0 0 f t r 8 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1260 ( pg_shadow 86 PGUID 0 0 0 0 f t r 8 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 1261 ( pg_group 87 PGUID 0 0 0 f t r 3 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1261 ( pg_group 87 PGUID 0 0 0 0 f t r 3 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 1262 ( pg_database 88 PGUID 0 0 0 f t r 4 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1262 ( pg_database 88 PGUID 0 0 0 0 f t r 4 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 1264 ( pg_variable 90 PGUID 0 0 0 f t s 1 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1264 ( pg_variable 90 PGUID 0 0 0 0 f t s 1 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 1269 ( pg_log 99 PGUID 0 0 0 f t s 1 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1269 ( pg_log 99 PGUID 0 0 0 0 f t s 1 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 376 ( pg_xactlock 0 PGUID 0 0 0 f t s 1 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 376 ( pg_xactlock 0 PGUID 0 0 0 0 f t s 1 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 1215 ( pg_attrdef 109 PGUID 0 0 0 t t r 4 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1215 ( pg_attrdef 109 PGUID 0 0 0 0 t t r 4 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 1216 ( pg_relcheck 110 PGUID 0 0 0 t t r 4 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1216 ( pg_relcheck 110 PGUID 0 0 0 0 t t r 4 0 0 0 0 0 f f _null_ ));
DESCR("");
DATA(insert OID = 1219 ( pg_trigger 111 PGUID 0 0 0 t t r 13 0 0 0 0 0 f f _null_ ));
DATA(insert OID = 1219 ( pg_trigger 111 PGUID 0 0 0 0 t t r 13 0 0 0 0 0 f f _null_ ));
DESCR("");
#define RelOid_pg_type 1247
......@@ -175,5 +177,6 @@ DESCR("");
#define RELKIND_SPECIAL 's' /* special (non-heap) */
#define RELKIND_SEQUENCE 'S' /* SEQUENCE relation */
#define RELKIND_UNCATALOGED 'u' /* temporary heap */
#define RELKIND_LONGVALUE 'v' /* moved off huge values */
#endif /* PG_RELATION_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment