Index: doc/src/sgml/catalogs.sgml =================================================================== RCS file: /projects/cvsroot/pgsql-server/doc/src/sgml/catalogs.sgml,v retrieving revision 2.54 diff -c -r2.54 catalogs.sgml *** doc/src/sgml/catalogs.sgml 2002/08/24 15:00:45 2.54 --- doc/src/sgml/catalogs.sgml 2002/08/26 20:30:35 *************** *** 821,826 **** --- 821,836 ---- + + attisinherited + bool + + + This column is inherited from some other relation. An inherited + column cannot be dropped nor renamed. + + + Index: src/backend/access/common/tupdesc.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/access/common/tupdesc.c,v retrieving revision 1.85 diff -c -r1.85 tupdesc.c *** src/backend/access/common/tupdesc.c 2002/08/05 02:30:49 1.85 --- src/backend/access/common/tupdesc.c 2002/08/26 20:30:36 *************** *** 341,347 **** Oid oidtypeid, int32 typmod, int attdim, ! bool attisset) { HeapTuple tuple; Form_pg_type typeForm; --- 341,348 ---- Oid oidtypeid, int32 typmod, int attdim, ! bool attisset, ! bool attisinherited) { HeapTuple tuple; Form_pg_type typeForm; *************** *** 389,394 **** --- 390,396 ---- att->attnotnull = false; att->atthasdef = false; att->attisdropped = false; + att->attisinherited = attisinherited; tuple = SearchSysCache(TYPEOID, ObjectIdGetDatum(oidtypeid), *************** *** 484,489 **** --- 486,492 ---- int attdim; int ndef = 0; bool attisset; + bool attisinherited; /* * allocate a new tuple descriptor *************** *** 509,518 **** attisset = entry->typename->setof; atttypmod = entry->typename->typmod; attdim = length(entry->typename->arrayBounds); TupleDescInitEntry(desc, attnum, attname, typenameTypeId(entry->typename), ! atttypmod, attdim, attisset); /* This is for constraints */ if (entry->is_not_null) --- 512,522 ---- attisset = entry->typename->setof; atttypmod = entry->typename->typmod; attdim = length(entry->typename->arrayBounds); + attisinherited = entry->is_inherited; TupleDescInitEntry(desc, attnum, attname, typenameTypeId(entry->typename), ! atttypmod, attdim, attisset, attisinherited); /* This is for constraints */ if (entry->is_not_null) *************** *** 668,673 **** --- 672,678 ---- typeoid, -1, 0, + false, false); } else if (functyptype == 'p' && typeoid == RECORDOID) Index: src/backend/commands/explain.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/commands/explain.c,v retrieving revision 1.84 diff -c -r1.84 explain.c *** src/backend/commands/explain.c 2002/07/20 15:12:55 1.84 --- src/backend/commands/explain.c 2002/08/26 20:30:37 *************** *** 71,77 **** /* need a tuple descriptor representing a single TEXT column */ tupdesc = CreateTemplateTupleDesc(1, WITHOUTOID); TupleDescInitEntry(tupdesc, (AttrNumber) 1, "QUERY PLAN", ! TEXTOID, -1, 0, false); /* prepare for projection of tuples */ tstate = begin_tup_output_tupdesc(dest, tupdesc); --- 71,77 ---- /* need a tuple descriptor representing a single TEXT column */ tupdesc = CreateTemplateTupleDesc(1, WITHOUTOID); TupleDescInitEntry(tupdesc, (AttrNumber) 1, "QUERY PLAN", ! TEXTOID, -1, 0, false, false); /* prepare for projection of tuples */ tstate = begin_tup_output_tupdesc(dest, tupdesc); Index: src/backend/commands/tablecmds.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/commands/tablecmds.c,v retrieving revision 1.33 diff -c -r1.33 tablecmds.c *** src/backend/commands/tablecmds.c 2002/08/24 15:00:46 1.33 --- src/backend/commands/tablecmds.c 2002/08/26 20:30:43 *************** *** 36,41 **** --- 36,42 ---- #include "nodes/makefuncs.h" #include "optimizer/clauses.h" #include "optimizer/planmain.h" + #include "optimizer/plancat.h" #include "optimizer/prep.h" #include "parser/gramparse.h" #include "parser/parse_coerce.h" *************** *** 615,620 **** --- 616,622 ---- typename->typmod = attribute->atttypmod; def->typename = typename; def->is_not_null = attribute->attnotnull; + def->is_inherited = true; def->raw_default = NULL; def->cooked_default = NULL; def->constraints = NIL; *************** *** 1052,1058 **** renameatt(Oid relid, const char *oldattname, const char *newattname, ! bool recurse) { Relation targetrelation; Relation attrelation; --- 1054,1061 ---- renameatt(Oid relid, const char *oldattname, const char *newattname, ! bool recurse, ! bool recursing) { Relation targetrelation; Relation attrelation; *************** *** 1074,1080 **** */ if (!allowSystemTableMods && IsSystemRelation(targetrelation)) ! elog(ERROR, "renameatt: class \"%s\" is a system catalog", RelationGetRelationName(targetrelation)); if (!pg_class_ownercheck(relid, GetUserId())) aclcheck_error(ACLCHECK_NOT_OWNER, --- 1077,1083 ---- */ if (!allowSystemTableMods && IsSystemRelation(targetrelation)) ! elog(ERROR, "ALTER TABLE: class \"%s\" is a system catalog", RelationGetRelationName(targetrelation)); if (!pg_class_ownercheck(relid, GetUserId())) aclcheck_error(ACLCHECK_NOT_OWNER, *************** *** 1109,1136 **** if (childrelid == relid) continue; /* note we need not recurse again! */ ! renameatt(childrelid, oldattname, newattname, false); } } attrelation = heap_openr(AttributeRelationName, RowExclusiveLock); atttup = SearchSysCacheCopyAttName(relid, oldattname); if (!HeapTupleIsValid(atttup)) ! elog(ERROR, "renameatt: attribute \"%s\" does not exist", oldattname); if (((Form_pg_attribute) GETSTRUCT(atttup))->attnum < 0) ! elog(ERROR, "renameatt: system attribute \"%s\" may not be renamed", oldattname); /* should not already exist */ /* this test is deliberately not attisdropped-aware */ if (SearchSysCacheExists(ATTNAME, ObjectIdGetDatum(relid), PointerGetDatum(newattname), 0, 0)) ! elog(ERROR, "renameatt: attribute \"%s\" exists", newattname); namestrcpy(&(((Form_pg_attribute) GETSTRUCT(atttup))->attname), newattname); --- 1112,1160 ---- if (childrelid == relid) continue; /* note we need not recurse again! */ ! renameatt(childrelid, oldattname, newattname, false, true); } } + /* Second case: we were asked not to recurse and are not recursing. + * In this case if there are inheritors the renaming should be + * forbidden. + */ + else if (recursing == false) + { + List *children = find_inheritance_children(relid); + if (children != NIL) + elog(ERROR, "ALTER TABLE: Renaming of inherited attribute \"%s\" forbidden", + oldattname); + } attrelation = heap_openr(AttributeRelationName, RowExclusiveLock); atttup = SearchSysCacheCopyAttName(relid, oldattname); if (!HeapTupleIsValid(atttup)) ! elog(ERROR, "ALTER TABLE: attribute \"%s\" does not exist", oldattname); if (((Form_pg_attribute) GETSTRUCT(atttup))->attnum < 0) ! elog(ERROR, "ALTER TABLE: system attribute \"%s\" may not be renamed", oldattname); + /* + * if the attribute is inherited, forbid the renaming, unless we + * are renaming recursively and are not in the parent. + */ + if (((Form_pg_attribute) GETSTRUCT(atttup))->attisinherited == true && + !recursing) + elog(ERROR, "ALTER TABLE: inherited attribute \"%s\" may not be renamed", + oldattname); + + /* should not already exist */ /* this test is deliberately not attisdropped-aware */ if (SearchSysCacheExists(ATTNAME, ObjectIdGetDatum(relid), PointerGetDatum(newattname), 0, 0)) ! elog(ERROR, "ALTER TABLE: attribute \"%s\" exists", newattname); namestrcpy(&(((Form_pg_attribute) GETSTRUCT(atttup))->attname), newattname); *************** *** 1161,1167 **** ObjectIdGetDatum(indexoid), 0, 0, 0); if (!HeapTupleIsValid(indextup)) ! elog(ERROR, "renameatt: can't find index id %u", indexoid); if (OidIsValid(((Form_pg_index) GETSTRUCT(indextup))->indproc)) { ReleaseSysCache(indextup); --- 1185,1191 ---- ObjectIdGetDatum(indexoid), 0, 0, 0); if (!HeapTupleIsValid(indextup)) ! elog(ERROR, "ALTER TABLE: can't find index id %u", indexoid); if (OidIsValid(((Form_pg_index) GETSTRUCT(indextup))->indproc)) { ReleaseSysCache(indextup); *************** *** 1561,1566 **** --- 1585,1591 ---- void AlterTableAddColumn(Oid myrelid, bool inherits, + bool recursing, ColumnDef *colDef) { Relation rel, *************** *** 1614,1620 **** --- 1639,1648 ---- { List *child, *children; + ColumnDef *colDefChild = copyObject(colDef); + colDefChild->is_inherited = true; + /* this routine is actually in the planner */ children = find_all_inheritors(myrelid); *************** *** 1630,1638 **** if (childrelid == myrelid) continue; ! AlterTableAddColumn(childrelid, false, colDef); } } /* * OK, get on with it... --- 1658,1677 ---- if (childrelid == myrelid) continue; ! AlterTableAddColumn(childrelid, false, true, colDefChild); } + + pfree(colDefChild); } + /* Second case: if asked not to recurse and not already recursing, + * forbid the add unless the relation doesn't have inheritors. + */ + else if (recursing == false) + { + List *children = find_inheritance_children(myrelid); + if (children != NIL) + elog(ERROR, "ALTER TABLE: Cannot add an attribute to only inherited table"); + } /* * OK, get on with it... *************** *** 1716,1721 **** --- 1755,1761 ---- attribute->atthasdef = (colDef->raw_default != NULL || colDef->cooked_default != NULL); attribute->attisdropped = false; + attribute->attisinherited = colDef->is_inherited; ReleaseSysCache(typeTuple); *************** *** 2285,2291 **** */ void AlterTableDropColumn(Oid myrelid, ! bool inh, const char *colName, DropBehavior behavior) { Relation rel; --- 2325,2331 ---- */ void AlterTableDropColumn(Oid myrelid, ! bool inh, bool recursing, const char *colName, DropBehavior behavior) { Relation rel; *************** *** 2322,2327 **** --- 2362,2368 ---- elog(ERROR, "ALTER TABLE: Cannot drop system attribute \"%s\"", colName); + /* * Make sure there will be at least one user column left in the relation * after we drop this one. Zero-length tuples tend to confuse us. *************** *** 2344,2349 **** --- 2385,2434 ---- elog(ERROR, "ALTER TABLE: Cannot drop last column from table \"%s\"", RelationGetRelationName(rel)); + /* Don't drop inherited column. */ + if (tupleDesc->attrs[attnum - 1]->attisinherited == true && + recursing == false) + { + elog(ERROR, "ALTER TABLE: Cannot drop inherited column \"%s\" from table \"%s\"", + colName, RelationGetRelationName(rel)); + } + + /* If we are asked to drop ONLY in this table (no recursion), + * we need to mark the inheritors' attribute as non-inherited. + */ + if (inh == false && recursing == false) + { + Relation attr_rel; + HeapTuple tuple; + List *child, + *children; + + /* We only need direct inheritors */ + children = find_inheritance_children(myrelid); + attr_rel = heap_openr(AttributeRelationName, RowExclusiveLock); + foreach (child, children) + { + /* + * Okay, actually perform the catalog change + */ + Oid childrelid = lfirsti(child); + + tuple = SearchSysCacheCopyAttName(childrelid, colName); + if (!HeapTupleIsValid(tuple)) /* shouldn't happen */ + elog(ERROR, "ALTER TABLE: relation %u has no column \"%s\"", + childrelid, colName); + + ((Form_pg_attribute) GETSTRUCT(tuple))->attisinherited = false; + + simple_heap_update(attr_rel, &tuple->t_self, tuple); + + /* keep the system catalog indexes current */ + CatalogUpdateIndexes(attr_rel, tuple); + } + heap_close(attr_rel, RowExclusiveLock); + } + + /* * Propagate to children if desired */ *************** *** 2367,2373 **** if (childrelid == myrelid) continue; AlterTableDropColumn(childrelid, ! false, colName, behavior); } } --- 2452,2458 ---- if (childrelid == myrelid) continue; AlterTableDropColumn(childrelid, ! false, true, colName, behavior); } } *************** *** 3378,3392 **** TupleDescInitEntry(tupdesc, (AttrNumber) 1, "chunk_id", OIDOID, ! -1, 0, false); TupleDescInitEntry(tupdesc, (AttrNumber) 2, "chunk_seq", INT4OID, ! -1, 0, false); TupleDescInitEntry(tupdesc, (AttrNumber) 3, "chunk_data", BYTEAOID, ! -1, 0, false); /* * Ensure that the toast table doesn't itself get toasted, or we'll be --- 3463,3477 ---- TupleDescInitEntry(tupdesc, (AttrNumber) 1, "chunk_id", OIDOID, ! -1, 0, false, false); TupleDescInitEntry(tupdesc, (AttrNumber) 2, "chunk_seq", INT4OID, ! -1, 0, false, false); TupleDescInitEntry(tupdesc, (AttrNumber) 3, "chunk_data", BYTEAOID, ! -1, 0, false, false); /* * Ensure that the toast table doesn't itself get toasted, or we'll be Index: src/backend/executor/execTuples.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/executor/execTuples.c,v retrieving revision 1.56 diff -c -r1.56 execTuples.c *** src/backend/executor/execTuples.c 2002/07/20 05:49:27 1.56 --- src/backend/executor/execTuples.c 2002/08/26 20:30:45 *************** *** 597,602 **** --- 597,603 ---- restype, resdom->restypmod, 0, + false, false); #ifdef NOT_USED *************** *** 632,637 **** --- 633,639 ---- restype, fjRes->restypmod, 0, + false, false); #ifdef NOT_USED ExecSetTypeInfo(fjRes->resno - 1, *************** *** 656,661 **** --- 658,664 ---- restype, fjRes->restypmod, 0, + false, false); #ifdef NOT_USED Index: src/backend/executor/nodeFunctionscan.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/executor/nodeFunctionscan.c,v retrieving revision 1.5 diff -c -r1.5 nodeFunctionscan.c *** src/backend/executor/nodeFunctionscan.c 2002/08/05 02:30:50 1.5 --- src/backend/executor/nodeFunctionscan.c 2002/08/26 20:30:46 *************** *** 241,246 **** --- 241,247 ---- funcrettype, -1, 0, + false, false); scanstate->returnsTuple = false; } Index: src/backend/tcop/utility.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/tcop/utility.c,v retrieving revision 1.172 diff -c -r1.172 utility.c *** src/backend/tcop/utility.c 2002/08/17 13:04:15 1.172 --- src/backend/tcop/utility.c 2002/08/26 20:30:48 *************** *** 417,423 **** renameatt(relid, stmt->oldname, /* old att name */ stmt->newname, /* new att name */ ! interpretInhOption(stmt->relation->inhOpt)); /* recursive? */ break; case RENAME_TRIGGER: renametrig(relid, --- 417,424 ---- renameatt(relid, stmt->oldname, /* old att name */ stmt->newname, /* new att name */ ! interpretInhOption(stmt->relation->inhOpt), /* recursive? */ ! false); /* recursing already? */ break; case RENAME_TRIGGER: renametrig(relid, *************** *** 457,462 **** --- 458,464 ---- */ AlterTableAddColumn(relid, interpretInhOption(stmt->relation->inhOpt), + false, (ColumnDef *) stmt->def); break; case 'T': /* ALTER COLUMN DEFAULT */ *************** *** 492,504 **** &(stmt->subtype)); break; case 'D': /* DROP COLUMN */ ! /* ! * XXX We don't actually recurse yet, but what we should do would be: * Recursively drop column from table and, * if requested, from descendants */ AlterTableDropColumn(relid, interpretInhOption(stmt->relation->inhOpt), stmt->name, stmt->behavior); break; --- 494,506 ---- &(stmt->subtype)); break; case 'D': /* DROP COLUMN */ ! /* * Recursively drop column from table and, * if requested, from descendants */ AlterTableDropColumn(relid, interpretInhOption(stmt->relation->inhOpt), + false, stmt->name, stmt->behavior); break; Index: src/backend/utils/misc/guc.c =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/backend/utils/misc/guc.c,v retrieving revision 1.83 diff -c -r1.83 guc.c *** src/backend/utils/misc/guc.c 2002/08/18 03:03:25 1.83 --- src/backend/utils/misc/guc.c 2002/08/26 20:30:53 *************** *** 2278,2284 **** /* need a tuple descriptor representing a single TEXT column */ tupdesc = CreateTemplateTupleDesc(1, WITHOUTOID); TupleDescInitEntry(tupdesc, (AttrNumber) 1, (char *) varname, ! TEXTOID, -1, 0, false); /* prepare for projection of tuples */ tstate = begin_tup_output_tupdesc(dest, tupdesc); --- 2278,2284 ---- /* need a tuple descriptor representing a single TEXT column */ tupdesc = CreateTemplateTupleDesc(1, WITHOUTOID); TupleDescInitEntry(tupdesc, (AttrNumber) 1, (char *) varname, ! TEXTOID, -1, 0, false, false); /* prepare for projection of tuples */ tstate = begin_tup_output_tupdesc(dest, tupdesc); *************** *** 2304,2312 **** /* need a tuple descriptor representing two TEXT columns */ tupdesc = CreateTemplateTupleDesc(2, WITHOUTOID); TupleDescInitEntry(tupdesc, (AttrNumber) 1, "name", ! TEXTOID, -1, 0, false); TupleDescInitEntry(tupdesc, (AttrNumber) 2, "setting", ! TEXTOID, -1, 0, false); /* prepare for projection of tuples */ tstate = begin_tup_output_tupdesc(dest, tupdesc); --- 2304,2312 ---- /* need a tuple descriptor representing two TEXT columns */ tupdesc = CreateTemplateTupleDesc(2, WITHOUTOID); TupleDescInitEntry(tupdesc, (AttrNumber) 1, "name", ! TEXTOID, -1, 0, false, false); TupleDescInitEntry(tupdesc, (AttrNumber) 2, "setting", ! TEXTOID, -1, 0, false, false); /* prepare for projection of tuples */ tstate = begin_tup_output_tupdesc(dest, tupdesc); *************** *** 2431,2439 **** /* need a tuple descriptor representing two TEXT columns */ tupdesc = CreateTemplateTupleDesc(2, WITHOUTOID); TupleDescInitEntry(tupdesc, (AttrNumber) 1, "name", ! TEXTOID, -1, 0, false); TupleDescInitEntry(tupdesc, (AttrNumber) 2, "setting", ! TEXTOID, -1, 0, false); /* allocate a slot for a tuple with this tupdesc */ slot = TupleDescGetSlot(tupdesc); --- 2431,2439 ---- /* need a tuple descriptor representing two TEXT columns */ tupdesc = CreateTemplateTupleDesc(2, WITHOUTOID); TupleDescInitEntry(tupdesc, (AttrNumber) 1, "name", ! TEXTOID, -1, 0, false, false); TupleDescInitEntry(tupdesc, (AttrNumber) 2, "setting", ! TEXTOID, -1, 0, false, false); /* allocate a slot for a tuple with this tupdesc */ slot = TupleDescGetSlot(tupdesc); Index: src/include/access/tupdesc.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/access/tupdesc.h,v retrieving revision 1.37 diff -c -r1.37 tupdesc.h *** src/include/access/tupdesc.h 2002/07/20 05:16:59 1.37 --- src/include/access/tupdesc.h 2002/08/26 20:30:55 *************** *** 94,100 **** Oid oidtypeid, int32 typmod, int attdim, ! bool attisset); extern TupleDesc BuildDescForRelation(List *schema); --- 94,101 ---- Oid oidtypeid, int32 typmod, int attdim, ! bool attisset, ! bool attisinherited); extern TupleDesc BuildDescForRelation(List *schema); Index: src/include/catalog/pg_attribute.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/catalog/pg_attribute.h,v retrieving revision 1.97 diff -c -r1.97 pg_attribute.h *** src/include/catalog/pg_attribute.h 2002/08/08 19:37:11 1.97 --- src/include/catalog/pg_attribute.h 2002/08/26 20:30:56 *************** *** 146,151 **** --- 146,154 ---- /* Is dropped (ie, logically invisible) or not */ bool attisdropped; + + /* This attribute is inherited */ + bool attisinherited; } FormData_pg_attribute; /* *************** *** 154,160 **** * because of alignment padding at the end of the struct.) */ #define ATTRIBUTE_TUPLE_SIZE \ ! (offsetof(FormData_pg_attribute,attisdropped) + sizeof(bool)) /* ---------------- * Form_pg_attribute corresponds to a pointer to a tuple with --- 157,163 ---- * because of alignment padding at the end of the struct.) */ #define ATTRIBUTE_TUPLE_SIZE \ ! (offsetof(FormData_pg_attribute,attisinherited) + sizeof(bool)) /* ---------------- * Form_pg_attribute corresponds to a pointer to a tuple with *************** *** 168,174 **** * ---------------- */ ! #define Natts_pg_attribute 16 #define Anum_pg_attribute_attrelid 1 #define Anum_pg_attribute_attname 2 #define Anum_pg_attribute_atttypid 3 --- 171,177 ---- * ---------------- */ ! #define Natts_pg_attribute 17 #define Anum_pg_attribute_attrelid 1 #define Anum_pg_attribute_attname 2 #define Anum_pg_attribute_atttypid 3 *************** *** 185,190 **** --- 188,194 ---- #define Anum_pg_attribute_attnotnull 14 #define Anum_pg_attribute_atthasdef 15 #define Anum_pg_attribute_attisdropped 16 + #define Anum_pg_attribute_attisinherited 17 *************** *** 215,480 **** * ---------------- */ #define Schema_pg_type \ ! { 1247, {"typname"}, 19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', false, 'i', true, false, false }, \ ! { 1247, {"typnamespace"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1247, {"typowner"}, 23, 0, 4, 3, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1247, {"typlen"}, 21, 0, 2, 4, 0, -1, -1, true, 'p', false, 's', true, false, false }, \ ! { 1247, {"typbyval"}, 16, 0, 1, 5, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1247, {"typtype"}, 18, -1, 1, 6, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1247, {"typisdefined"}, 16, -1, 1, 7, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1247, {"typdelim"}, 18, 0, 1, 8, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1247, {"typrelid"}, 26, 0, 4, 9, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1247, {"typelem"}, 26, 0, 4, 10, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1247, {"typinput"}, 24, 0, 4, 11, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1247, {"typoutput"}, 24, 0, 4, 12, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1247, {"typalign"}, 18, 0, 1, 13, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1247, {"typstorage"}, 18, 0, 1, 14, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1247, {"typnotnull"}, 16, 0, 1, 15, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1247, {"typbasetype"}, 26, 0, 4, 16, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1247, {"typtypmod"}, 23, 0, 4, 17, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1247, {"typndims"}, 23, 0, 4, 18, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1247, {"typdefaultbin"}, 25, 0, -1, 19, 0, -1, -1, false, 'x', false, 'i', false, false, false }, \ ! { 1247, {"typdefault"}, 25, 0, -1, 20, 0, -1, -1, false, 'x', false, 'i', false, false, false } ! ! ! DATA(insert ( 1247 typname 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1247 typnamespace 26 -1 4 2 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 typowner 23 0 4 3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 typlen 21 0 2 4 0 -1 -1 t p f s t f f)); ! DATA(insert ( 1247 typbyval 16 0 1 5 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1247 typtype 18 -1 1 6 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1247 typisdefined 16 -1 1 7 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1247 typdelim 18 0 1 8 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1247 typrelid 26 0 4 9 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 typelem 26 0 4 10 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 typinput 24 0 4 11 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 typoutput 24 0 4 12 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 typalign 18 0 1 13 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1247 typstorage 18 0 1 14 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1247 typnotnull 16 0 1 15 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1247 typbasetype 26 0 4 16 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 typtypmod 23 0 4 17 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 typndims 23 0 4 18 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 typdefaultbin 25 0 -1 19 0 -1 -1 f x f i f f f)); ! DATA(insert ( 1247 typdefault 25 0 -1 20 0 -1 -1 f x f i f f f)); ! DATA(insert ( 1247 ctid 27 0 6 -1 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1247 oid 26 0 4 -2 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 xmin 28 0 4 -3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 cmin 29 0 4 -4 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 xmax 28 0 4 -5 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 cmax 29 0 4 -6 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1247 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f)); /* ---------------- * pg_database * ---------------- */ ! DATA(insert ( 1262 datname 19 0 NAMEDATALEN 1 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1262 datdba 23 0 4 2 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1262 encoding 23 0 4 3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1262 datistemplate 16 0 1 4 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1262 datallowconn 16 0 1 5 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1262 datlastsysoid 26 0 4 6 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1262 datvacuumxid 28 0 4 7 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1262 datfrozenxid 28 0 4 8 0 -1 -1 t p f i t f f)); /* do not mark datpath as toastable; GetRawDatabaseInfo won't cope */ ! DATA(insert ( 1262 datpath 25 0 -1 9 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1262 datconfig 1009 0 -1 10 0 -1 -1 f x f i f f f)); ! DATA(insert ( 1262 datacl 1034 0 -1 11 0 -1 -1 f x f i f f f)); ! DATA(insert ( 1262 ctid 27 0 6 -1 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1262 oid 26 0 4 -2 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1262 xmin 28 0 4 -3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1262 cmin 29 0 4 -4 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1262 xmax 28 0 4 -5 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1262 cmax 29 0 4 -6 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1262 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f)); /* ---------------- * pg_proc * ---------------- */ #define Schema_pg_proc \ ! { 1255, {"proname"}, 19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', false, 'i', true, false, false }, \ ! { 1255, {"pronamespace"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1255, {"proowner"}, 23, 0, 4, 3, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1255, {"prolang"}, 26, 0, 4, 4, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1255, {"proisagg"}, 16, -1, 1, 5, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1255, {"prosecdef"}, 16, 0, 1, 6, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1255, {"proisstrict"}, 16, 0, 1, 7, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1255, {"proretset"}, 16, 0, 1, 8, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1255, {"provolatile"}, 18, 0, 1, 9, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1255, {"pronargs"}, 21, 0, 2, 10, 0, -1, -1, true, 'p', false, 's', true, false, false }, \ ! { 1255, {"prorettype"}, 26, 0, 4, 11, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1255, {"proargtypes"}, 30, 0, INDEX_MAX_KEYS*4, 12, 0, -1, -1, false, 'p', false, 'i', true, false, false }, \ ! { 1255, {"prosrc"}, 25, 0, -1, 13, 0, -1, -1, false, 'x', false, 'i', false, false, false }, \ ! { 1255, {"probin"}, 17, 0, -1, 14, 0, -1, -1, false, 'x', false, 'i', false, false, false }, \ ! { 1255, {"proacl"}, 1034, 0, -1, 15, 0, -1, -1, false, 'x', false, 'i', false, false, false } ! ! DATA(insert ( 1255 proname 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1255 pronamespace 26 -1 4 2 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1255 proowner 23 0 4 3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1255 prolang 26 0 4 4 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1255 proisagg 16 -1 1 5 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1255 prosecdef 16 0 1 6 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1255 proisstrict 16 0 1 7 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1255 proretset 16 0 1 8 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1255 provolatile 18 0 1 9 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1255 pronargs 21 0 2 10 0 -1 -1 t p f s t f f)); ! DATA(insert ( 1255 prorettype 26 0 4 11 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1255 proargtypes 30 0 INDEX_MAX_KEYS*4 12 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1255 prosrc 25 0 -1 13 0 -1 -1 f x f i f f f)); ! DATA(insert ( 1255 probin 17 0 -1 14 0 -1 -1 f x f i f f f)); ! DATA(insert ( 1255 proacl 1034 0 -1 15 0 -1 -1 f x f i f f f)); ! DATA(insert ( 1255 ctid 27 0 6 -1 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1255 oid 26 0 4 -2 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1255 xmin 28 0 4 -3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1255 cmin 29 0 4 -4 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1255 xmax 28 0 4 -5 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1255 cmax 29 0 4 -6 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1255 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f)); /* ---------------- * pg_shadow * ---------------- */ ! DATA(insert ( 1260 usename 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1260 usesysid 23 -1 4 2 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1260 usecreatedb 16 0 1 3 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1260 usesuper 16 0 1 4 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1260 usecatupd 16 0 1 5 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1260 passwd 25 0 -1 6 0 -1 -1 f x f i f f f)); ! DATA(insert ( 1260 valuntil 702 0 4 7 0 -1 -1 t p f i f f f)); ! DATA(insert ( 1260 useconfig 1009 0 -1 8 0 -1 -1 f x f i f f f)); ! DATA(insert ( 1260 ctid 27 0 6 -1 0 -1 -1 f p f i t f f)); /* no OIDs in pg_shadow */ ! DATA(insert ( 1260 xmin 28 0 4 -3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1260 cmin 29 0 4 -4 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1260 xmax 28 0 4 -5 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1260 cmax 29 0 4 -6 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1260 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f)); /* ---------------- * pg_group * ---------------- */ ! DATA(insert ( 1261 groname 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1261 grosysid 23 -1 4 2 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1261 grolist 1007 0 -1 3 0 -1 -1 f x f i f f f)); ! DATA(insert ( 1261 ctid 27 0 6 -1 0 -1 -1 f p f i t f f)); /* no OIDs in pg_group */ ! DATA(insert ( 1261 xmin 28 0 4 -3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1261 cmin 29 0 4 -4 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1261 xmax 28 0 4 -5 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1261 cmax 29 0 4 -6 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1261 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f)); /* ---------------- * pg_attribute * ---------------- */ #define Schema_pg_attribute \ ! { 1249, {"attrelid"}, 26, -1, 4, 1, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1249, {"attname"}, 19, -1, NAMEDATALEN, 2, 0, -1, -1, false, 'p', false, 'i', true, false, false }, \ ! { 1249, {"atttypid"}, 26, 0, 4, 3, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1249, {"attstattarget"}, 23, 0, 4, 4, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1249, {"attlen"}, 21, 0, 2, 5, 0, -1, -1, true, 'p', false, 's', true, false, false }, \ ! { 1249, {"attnum"}, 21, 0, 2, 6, 0, -1, -1, true, 'p', false, 's', true, false, false }, \ ! { 1249, {"attndims"}, 23, 0, 4, 7, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1249, {"attcacheoff"}, 23, 0, 4, 8, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1249, {"atttypmod"}, 23, 0, 4, 9, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1249, {"attbyval"}, 16, 0, 1, 10, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1249, {"attstorage"}, 18, 0, 1, 11, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1249, {"attisset"}, 16, 0, 1, 12, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1249, {"attalign"}, 18, 0, 1, 13, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1249, {"attnotnull"}, 16, 0, 1, 14, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1249, {"atthasdef"}, 16, 0, 1, 15, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1249, {"attisdropped"}, 16, 0, 1, 16, 0, -1, -1, true, 'p', false, 'c', true, false, false } ! ! DATA(insert ( 1249 attrelid 26 -1 4 1 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1249 attname 19 -1 NAMEDATALEN 2 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1249 atttypid 26 0 4 3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1249 attstattarget 23 0 4 4 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1249 attlen 21 0 2 5 0 -1 -1 t p f s t f f)); ! DATA(insert ( 1249 attnum 21 0 2 6 0 -1 -1 t p f s t f f)); ! DATA(insert ( 1249 attndims 23 0 4 7 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1249 attcacheoff 23 0 4 8 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1249 atttypmod 23 0 4 9 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1249 attbyval 16 0 1 10 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1249 attstorage 18 0 1 11 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1249 attisset 16 0 1 12 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1249 attalign 18 0 1 13 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1249 attnotnull 16 0 1 14 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1249 atthasdef 16 0 1 15 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1249 attisdropped 16 0 1 16 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1249 ctid 27 0 6 -1 0 -1 -1 f p f i t f f)); /* no OIDs in pg_attribute */ ! DATA(insert ( 1249 xmin 28 0 4 -3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1249 cmin 29 0 4 -4 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1249 xmax 28 0 4 -5 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1249 cmax 29 0 4 -6 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1249 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f)); /* ---------------- * pg_class * ---------------- */ #define Schema_pg_class \ ! { 1259, {"relname"}, 19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', false, 'i', true, false, false }, \ ! { 1259, {"relnamespace"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1259, {"reltype"}, 26, 0, 4, 3, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1259, {"relowner"}, 23, 0, 4, 4, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1259, {"relam"}, 26, 0, 4, 5, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1259, {"relfilenode"}, 26, 0, 4, 6, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1259, {"relpages"}, 23, 0, 4, 7, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1259, {"reltuples"}, 700, 0, 4, 8, 0, -1, -1, false, 'p', false, 'i', true, false, false }, \ ! { 1259, {"reltoastrelid"}, 26, 0, 4, 9, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1259, {"reltoastidxid"}, 26, 0, 4, 10, 0, -1, -1, true, 'p', false, 'i', true, false, false }, \ ! { 1259, {"relhasindex"}, 16, 0, 1, 11, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1259, {"relisshared"}, 16, 0, 1, 12, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1259, {"relkind"}, 18, -1, 1, 13, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1259, {"relnatts"}, 21, 0, 2, 14, 0, -1, -1, true, 'p', false, 's', true, false, false }, \ ! { 1259, {"relchecks"}, 21, 0, 2, 15, 0, -1, -1, true, 'p', false, 's', true, false, false }, \ ! { 1259, {"reltriggers"}, 21, 0, 2, 16, 0, -1, -1, true, 'p', false, 's', true, false, false }, \ ! { 1259, {"relukeys"}, 21, 0, 2, 17, 0, -1, -1, true, 'p', false, 's', true, false, false }, \ ! { 1259, {"relfkeys"}, 21, 0, 2, 18, 0, -1, -1, true, 'p', false, 's', true, false, false }, \ ! { 1259, {"relrefs"}, 21, 0, 2, 19, 0, -1, -1, true, 'p', false, 's', true, false, false }, \ ! { 1259, {"relhasoids"}, 16, 0, 1, 20, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1259, {"relhaspkey"}, 16, 0, 1, 21, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1259, {"relhasrules"}, 16, 0, 1, 22, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1259, {"relhassubclass"},16, 0, 1, 23, 0, -1, -1, true, 'p', false, 'c', true, false, false }, \ ! { 1259, {"relacl"}, 1034, 0, -1, 24, 0, -1, -1, false, 'x', false, 'i', false, false, false } ! ! DATA(insert ( 1259 relname 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1259 relnamespace 26 -1 4 2 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 reltype 26 0 4 3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 relowner 23 0 4 4 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 relam 26 0 4 5 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 relfilenode 26 0 4 6 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 relpages 23 0 4 7 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 reltuples 700 0 4 8 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1259 reltoastrelid 26 0 4 9 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 reltoastidxid 26 0 4 10 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 relhasindex 16 0 1 11 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1259 relisshared 16 0 1 12 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1259 relkind 18 -1 1 13 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1259 relnatts 21 0 2 14 0 -1 -1 t p f s t f f)); ! DATA(insert ( 1259 relchecks 21 0 2 15 0 -1 -1 t p f s t f f)); ! DATA(insert ( 1259 reltriggers 21 0 2 16 0 -1 -1 t p f s t f f)); ! DATA(insert ( 1259 relukeys 21 0 2 17 0 -1 -1 t p f s t f f)); ! DATA(insert ( 1259 relfkeys 21 0 2 18 0 -1 -1 t p f s t f f)); ! DATA(insert ( 1259 relrefs 21 0 2 19 0 -1 -1 t p f s t f f)); ! DATA(insert ( 1259 relhasoids 16 0 1 20 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1259 relhaspkey 16 0 1 21 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1259 relhasrules 16 0 1 22 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1259 relhassubclass 16 0 1 23 0 -1 -1 t p f c t f f)); ! DATA(insert ( 1259 relacl 1034 0 -1 24 0 -1 -1 f x f i f f f)); ! DATA(insert ( 1259 ctid 27 0 6 -1 0 -1 -1 f p f i t f f)); ! DATA(insert ( 1259 oid 26 0 4 -2 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 xmin 28 0 4 -3 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 cmin 29 0 4 -4 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 xmax 28 0 4 -5 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 cmax 29 0 4 -6 0 -1 -1 t p f i t f f)); ! DATA(insert ( 1259 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f)); /* ---------------- * pg_xactlock - this is not a real relation, but is a placeholder --- 219,486 ---- * ---------------- */ #define Schema_pg_type \ ! { 1247, {"typname"}, 19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', false, 'i', true, false, false, false }, \ ! { 1247, {"typnamespace"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1247, {"typowner"}, 23, 0, 4, 3, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1247, {"typlen"}, 21, 0, 2, 4, 0, -1, -1, true, 'p', false, 's', true, false, false, false }, \ ! { 1247, {"typbyval"}, 16, 0, 1, 5, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1247, {"typtype"}, 18, -1, 1, 6, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1247, {"typisdefined"}, 16, -1, 1, 7, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1247, {"typdelim"}, 18, 0, 1, 8, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1247, {"typrelid"}, 26, 0, 4, 9, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1247, {"typelem"}, 26, 0, 4, 10, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1247, {"typinput"}, 24, 0, 4, 11, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1247, {"typoutput"}, 24, 0, 4, 12, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1247, {"typalign"}, 18, 0, 1, 13, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1247, {"typstorage"}, 18, 0, 1, 14, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1247, {"typnotnull"}, 16, 0, 1, 15, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1247, {"typbasetype"}, 26, 0, 4, 16, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1247, {"typtypmod"}, 23, 0, 4, 17, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1247, {"typndims"}, 23, 0, 4, 18, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1247, {"typdefaultbin"}, 25, 0, -1, 19, 0, -1, -1, false, 'x', false, 'i', false, false, false, false }, \ ! { 1247, {"typdefault"}, 25, 0, -1, 20, 0, -1, -1, false, 'x', false, 'i', false, false, false, false } ! ! ! DATA(insert ( 1247 typname 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1247 typnamespace 26 -1 4 2 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 typowner 23 0 4 3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 typlen 21 0 2 4 0 -1 -1 t p f s t f f f)); ! DATA(insert ( 1247 typbyval 16 0 1 5 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1247 typtype 18 -1 1 6 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1247 typisdefined 16 -1 1 7 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1247 typdelim 18 0 1 8 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1247 typrelid 26 0 4 9 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 typelem 26 0 4 10 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 typinput 24 0 4 11 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 typoutput 24 0 4 12 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 typalign 18 0 1 13 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1247 typstorage 18 0 1 14 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1247 typnotnull 16 0 1 15 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1247 typbasetype 26 0 4 16 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 typtypmod 23 0 4 17 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 typndims 23 0 4 18 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 typdefaultbin 25 0 -1 19 0 -1 -1 f x f i f f f f)); ! DATA(insert ( 1247 typdefault 25 0 -1 20 0 -1 -1 f x f i f f f f)); ! DATA(insert ( 1247 ctid 27 0 6 -1 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1247 oid 26 0 4 -2 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 xmin 28 0 4 -3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 cmin 29 0 4 -4 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 xmax 28 0 4 -5 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 cmax 29 0 4 -6 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1247 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f f)); /* ---------------- * pg_database * ---------------- */ ! DATA(insert ( 1262 datname 19 0 NAMEDATALEN 1 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1262 datdba 23 0 4 2 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1262 encoding 23 0 4 3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1262 datistemplate 16 0 1 4 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1262 datallowconn 16 0 1 5 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1262 datlastsysoid 26 0 4 6 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1262 datvacuumxid 28 0 4 7 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1262 datfrozenxid 28 0 4 8 0 -1 -1 t p f i t f f f)); /* do not mark datpath as toastable; GetRawDatabaseInfo won't cope */ ! DATA(insert ( 1262 datpath 25 0 -1 9 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1262 datconfig 1009 0 -1 10 0 -1 -1 f x f i f f f f)); ! DATA(insert ( 1262 datacl 1034 0 -1 11 0 -1 -1 f x f i f f f f)); ! DATA(insert ( 1262 ctid 27 0 6 -1 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1262 oid 26 0 4 -2 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1262 xmin 28 0 4 -3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1262 cmin 29 0 4 -4 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1262 xmax 28 0 4 -5 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1262 cmax 29 0 4 -6 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1262 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f f)); /* ---------------- * pg_proc * ---------------- */ #define Schema_pg_proc \ ! { 1255, {"proname"}, 19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', false, 'i', true, false, false, false }, \ ! { 1255, {"pronamespace"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1255, {"proowner"}, 23, 0, 4, 3, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1255, {"prolang"}, 26, 0, 4, 4, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1255, {"proisagg"}, 16, -1, 1, 5, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1255, {"prosecdef"}, 16, 0, 1, 6, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1255, {"proisstrict"}, 16, 0, 1, 7, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1255, {"proretset"}, 16, 0, 1, 8, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1255, {"provolatile"}, 18, 0, 1, 9, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1255, {"pronargs"}, 21, 0, 2, 10, 0, -1, -1, true, 'p', false, 's', true, false, false, false }, \ ! { 1255, {"prorettype"}, 26, 0, 4, 11, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1255, {"proargtypes"}, 30, 0, INDEX_MAX_KEYS*4, 12, 0, -1, -1, false, 'p', false, 'i', true, false, false, false }, \ ! { 1255, {"prosrc"}, 25, 0, -1, 13, 0, -1, -1, false, 'x', false, 'i', false, false, false, false }, \ ! { 1255, {"probin"}, 17, 0, -1, 14, 0, -1, -1, false, 'x', false, 'i', false, false, false, false }, \ ! { 1255, {"proacl"}, 1034, 0, -1, 15, 0, -1, -1, false, 'x', false, 'i', false, false, false, false } ! ! DATA(insert ( 1255 proname 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1255 pronamespace 26 -1 4 2 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1255 proowner 23 0 4 3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1255 prolang 26 0 4 4 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1255 proisagg 16 -1 1 5 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1255 prosecdef 16 0 1 6 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1255 proisstrict 16 0 1 7 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1255 proretset 16 0 1 8 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1255 provolatile 18 0 1 9 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1255 pronargs 21 0 2 10 0 -1 -1 t p f s t f f f)); ! DATA(insert ( 1255 prorettype 26 0 4 11 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1255 proargtypes 30 0 INDEX_MAX_KEYS*4 12 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1255 prosrc 25 0 -1 13 0 -1 -1 f x f i f f f f)); ! DATA(insert ( 1255 probin 17 0 -1 14 0 -1 -1 f x f i f f f f)); ! DATA(insert ( 1255 proacl 1034 0 -1 15 0 -1 -1 f x f i f f f f)); ! DATA(insert ( 1255 ctid 27 0 6 -1 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1255 oid 26 0 4 -2 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1255 xmin 28 0 4 -3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1255 cmin 29 0 4 -4 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1255 xmax 28 0 4 -5 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1255 cmax 29 0 4 -6 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1255 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f f)); /* ---------------- * pg_shadow * ---------------- */ ! DATA(insert ( 1260 usename 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1260 usesysid 23 -1 4 2 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1260 usecreatedb 16 0 1 3 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1260 usesuper 16 0 1 4 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1260 usecatupd 16 0 1 5 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1260 passwd 25 0 -1 6 0 -1 -1 f x f i f f f f)); ! DATA(insert ( 1260 valuntil 702 0 4 7 0 -1 -1 t p f i f f f f)); ! DATA(insert ( 1260 useconfig 1009 0 -1 8 0 -1 -1 f x f i f f f f)); ! DATA(insert ( 1260 ctid 27 0 6 -1 0 -1 -1 f p f i t f f f)); /* no OIDs in pg_shadow */ ! DATA(insert ( 1260 xmin 28 0 4 -3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1260 cmin 29 0 4 -4 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1260 xmax 28 0 4 -5 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1260 cmax 29 0 4 -6 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1260 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f f)); /* ---------------- * pg_group * ---------------- */ ! DATA(insert ( 1261 groname 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1261 grosysid 23 -1 4 2 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1261 grolist 1007 0 -1 3 0 -1 -1 f x f i f f f f)); ! DATA(insert ( 1261 ctid 27 0 6 -1 0 -1 -1 f p f i t f f f)); /* no OIDs in pg_group */ ! DATA(insert ( 1261 xmin 28 0 4 -3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1261 cmin 29 0 4 -4 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1261 xmax 28 0 4 -5 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1261 cmax 29 0 4 -6 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1261 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f f)); /* ---------------- * pg_attribute * ---------------- */ #define Schema_pg_attribute \ ! { 1249, {"attrelid"}, 26, -1, 4, 1, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1249, {"attname"}, 19, -1, NAMEDATALEN, 2, 0, -1, -1, false, 'p', false, 'i', true, false, false, false }, \ ! { 1249, {"atttypid"}, 26, 0, 4, 3, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1249, {"attstattarget"}, 23, 0, 4, 4, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1249, {"attlen"}, 21, 0, 2, 5, 0, -1, -1, true, 'p', false, 's', true, false, false, false }, \ ! { 1249, {"attnum"}, 21, 0, 2, 6, 0, -1, -1, true, 'p', false, 's', true, false, false, false }, \ ! { 1249, {"attndims"}, 23, 0, 4, 7, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1249, {"attcacheoff"}, 23, 0, 4, 8, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1249, {"atttypmod"}, 23, 0, 4, 9, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1249, {"attbyval"}, 16, 0, 1, 10, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1249, {"attstorage"}, 18, 0, 1, 11, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1249, {"attisset"}, 16, 0, 1, 12, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1249, {"attalign"}, 18, 0, 1, 13, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1249, {"attnotnull"}, 16, 0, 1, 14, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1249, {"atthasdef"}, 16, 0, 1, 15, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1249, {"attisdropped"}, 16, 0, 1, 16, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1249, {"attisinherited"}, 16, 0, 1, 17, 0, -1, -1, true, 'p', false, 'c', true, false, false, false } ! ! DATA(insert ( 1249 attrelid 26 -1 4 1 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1249 attname 19 -1 NAMEDATALEN 2 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1249 atttypid 26 0 4 3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1249 attstattarget 23 0 4 4 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1249 attlen 21 0 2 5 0 -1 -1 t p f s t f f f)); ! DATA(insert ( 1249 attnum 21 0 2 6 0 -1 -1 t p f s t f f f)); ! DATA(insert ( 1249 attndims 23 0 4 7 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1249 attcacheoff 23 0 4 8 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1249 atttypmod 23 0 4 9 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1249 attbyval 16 0 1 10 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1249 attstorage 18 0 1 11 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1249 attisset 16 0 1 12 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1249 attalign 18 0 1 13 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1249 attnotnull 16 0 1 14 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1249 atthasdef 16 0 1 15 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1249 attisdropped 16 0 1 16 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1249 attisinherited 16 0 1 17 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1249 ctid 27 0 6 -1 0 -1 -1 f p f i t f f f)); /* no OIDs in pg_attribute */ ! DATA(insert ( 1249 xmin 28 0 4 -3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1249 cmin 29 0 4 -4 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1249 xmax 28 0 4 -5 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1249 cmax 29 0 4 -6 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1249 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f f)); /* ---------------- * pg_class * ---------------- */ #define Schema_pg_class \ ! { 1259, {"relname"}, 19, -1, NAMEDATALEN, 1, 0, -1, -1, false, 'p', false, 'i', true, false, false, false }, \ ! { 1259, {"relnamespace"}, 26, -1, 4, 2, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1259, {"reltype"}, 26, 0, 4, 3, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1259, {"relowner"}, 23, 0, 4, 4, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1259, {"relam"}, 26, 0, 4, 5, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1259, {"relfilenode"}, 26, 0, 4, 6, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1259, {"relpages"}, 23, 0, 4, 7, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1259, {"reltuples"}, 700, 0, 4, 8, 0, -1, -1, false, 'p', false, 'i', true, false, false, false }, \ ! { 1259, {"reltoastrelid"}, 26, 0, 4, 9, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1259, {"reltoastidxid"}, 26, 0, 4, 10, 0, -1, -1, true, 'p', false, 'i', true, false, false, false }, \ ! { 1259, {"relhasindex"}, 16, 0, 1, 11, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1259, {"relisshared"}, 16, 0, 1, 12, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1259, {"relkind"}, 18, -1, 1, 13, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1259, {"relnatts"}, 21, 0, 2, 14, 0, -1, -1, true, 'p', false, 's', true, false, false, false }, \ ! { 1259, {"relchecks"}, 21, 0, 2, 15, 0, -1, -1, true, 'p', false, 's', true, false, false, false }, \ ! { 1259, {"reltriggers"}, 21, 0, 2, 16, 0, -1, -1, true, 'p', false, 's', true, false, false, false }, \ ! { 1259, {"relukeys"}, 21, 0, 2, 17, 0, -1, -1, true, 'p', false, 's', true, false, false, false }, \ ! { 1259, {"relfkeys"}, 21, 0, 2, 18, 0, -1, -1, true, 'p', false, 's', true, false, false, false }, \ ! { 1259, {"relrefs"}, 21, 0, 2, 19, 0, -1, -1, true, 'p', false, 's', true, false, false, false }, \ ! { 1259, {"relhasoids"}, 16, 0, 1, 20, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1259, {"relhaspkey"}, 16, 0, 1, 21, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1259, {"relhasrules"}, 16, 0, 1, 22, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1259, {"relhassubclass"},16, 0, 1, 23, 0, -1, -1, true, 'p', false, 'c', true, false, false, false }, \ ! { 1259, {"relacl"}, 1034, 0, -1, 24, 0, -1, -1, false, 'x', false, 'i', false, false, false, false } ! ! DATA(insert ( 1259 relname 19 -1 NAMEDATALEN 1 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1259 relnamespace 26 -1 4 2 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 reltype 26 0 4 3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 relowner 23 0 4 4 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 relam 26 0 4 5 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 relfilenode 26 0 4 6 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 relpages 23 0 4 7 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 reltuples 700 0 4 8 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1259 reltoastrelid 26 0 4 9 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 reltoastidxid 26 0 4 10 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 relhasindex 16 0 1 11 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1259 relisshared 16 0 1 12 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1259 relkind 18 -1 1 13 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1259 relnatts 21 0 2 14 0 -1 -1 t p f s t f f f)); ! DATA(insert ( 1259 relchecks 21 0 2 15 0 -1 -1 t p f s t f f f)); ! DATA(insert ( 1259 reltriggers 21 0 2 16 0 -1 -1 t p f s t f f f)); ! DATA(insert ( 1259 relukeys 21 0 2 17 0 -1 -1 t p f s t f f f)); ! DATA(insert ( 1259 relfkeys 21 0 2 18 0 -1 -1 t p f s t f f f)); ! DATA(insert ( 1259 relrefs 21 0 2 19 0 -1 -1 t p f s t f f f)); ! DATA(insert ( 1259 relhasoids 16 0 1 20 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1259 relhaspkey 16 0 1 21 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1259 relhasrules 16 0 1 22 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1259 relhassubclass 16 0 1 23 0 -1 -1 t p f c t f f f)); ! DATA(insert ( 1259 relacl 1034 0 -1 24 0 -1 -1 f x f i f f f f)); ! DATA(insert ( 1259 ctid 27 0 6 -1 0 -1 -1 f p f i t f f f)); ! DATA(insert ( 1259 oid 26 0 4 -2 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 xmin 28 0 4 -3 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 cmin 29 0 4 -4 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 xmax 28 0 4 -5 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 cmax 29 0 4 -6 0 -1 -1 t p f i t f f f)); ! DATA(insert ( 1259 tableoid 26 0 4 -7 0 -1 -1 t p f i t f f f)); /* ---------------- * pg_xactlock - this is not a real relation, but is a placeholder *************** *** 484,489 **** * table; and this entry is just to link to that one. * ---------------- */ ! DATA(insert ( 376 xactlockfoo 26 0 4 1 0 -1 -1 t p f i t f f)); #endif /* PG_ATTRIBUTE_H */ --- 490,495 ---- * table; and this entry is just to link to that one. * ---------------- */ ! DATA(insert ( 376 xactlockfoo 26 0 4 1 0 -1 -1 t p f i t f f f)); #endif /* PG_ATTRIBUTE_H */ Index: src/include/catalog/pg_class.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/catalog/pg_class.h,v retrieving revision 1.71 diff -c -r1.71 pg_class.h *** src/include/catalog/pg_class.h 2002/08/15 16:36:07 1.71 --- src/include/catalog/pg_class.h 2002/08/26 20:30:57 *************** *** 136,142 **** DATA(insert OID = 1247 ( pg_type PGNSP 71 PGUID 0 1247 0 0 0 0 f f r 20 0 0 0 0 0 t f f f _null_ )); DESCR(""); ! DATA(insert OID = 1249 ( pg_attribute PGNSP 75 PGUID 0 1249 0 0 0 0 f f r 16 0 0 0 0 0 f f f f _null_ )); DESCR(""); DATA(insert OID = 1255 ( pg_proc PGNSP 81 PGUID 0 1255 0 0 0 0 f f r 15 0 0 0 0 0 t f f f _null_ )); DESCR(""); --- 136,142 ---- DATA(insert OID = 1247 ( pg_type PGNSP 71 PGUID 0 1247 0 0 0 0 f f r 20 0 0 0 0 0 t f f f _null_ )); DESCR(""); ! DATA(insert OID = 1249 ( pg_attribute PGNSP 75 PGUID 0 1249 0 0 0 0 f f r 17 0 0 0 0 0 f f f f _null_ )); DESCR(""); DATA(insert OID = 1255 ( pg_proc PGNSP 81 PGUID 0 1255 0 0 0 0 f f r 15 0 0 0 0 0 t f f f _null_ )); DESCR(""); Index: src/include/commands/tablecmds.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/commands/tablecmds.h,v retrieving revision 1.5 diff -c -r1.5 tablecmds.h *** src/include/commands/tablecmds.h 2002/07/01 15:27:56 1.5 --- src/include/commands/tablecmds.h 2002/08/26 20:30:57 *************** *** 16,22 **** #include "nodes/parsenodes.h" ! extern void AlterTableAddColumn(Oid myrelid, bool inherits, ColumnDef *colDef); extern void AlterTableAlterColumnDefault(Oid myrelid, bool inh, --- 16,22 ---- #include "nodes/parsenodes.h" ! extern void AlterTableAddColumn(Oid myrelid, bool inherits, bool recursing, ColumnDef *colDef); extern void AlterTableAlterColumnDefault(Oid myrelid, bool inh, *************** *** 33,39 **** const char *colName, Node *flagValue, const char *flagType); ! extern void AlterTableDropColumn(Oid myrelid, bool inh, const char *colName, DropBehavior behavior); --- 33,39 ---- const char *colName, Node *flagValue, const char *flagType); ! extern void AlterTableDropColumn(Oid myrelid, bool inh, bool recursing, const char *colName, DropBehavior behavior); *************** *** 57,63 **** extern void renameatt(Oid relid, const char *oldattname, const char *newattname, ! bool recurse); extern void renamerel(Oid relid, const char *newrelname); --- 57,64 ---- extern void renameatt(Oid relid, const char *oldattname, const char *newattname, ! bool recurse, ! bool recursing); extern void renamerel(Oid relid, const char *newrelname); Index: src/include/nodes/parsenodes.h =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/include/nodes/parsenodes.h,v retrieving revision 1.201 diff -c -r1.201 parsenodes.h *** src/include/nodes/parsenodes.h 2002/08/19 15:08:47 1.201 --- src/include/nodes/parsenodes.h 2002/08/26 20:31:00 *************** *** 280,285 **** --- 280,286 ---- char *colname; /* name of column */ TypeName *typename; /* type of column */ bool is_not_null; /* NOT NULL constraint specified? */ + bool is_inherited; /* is inherited */ Node *raw_default; /* default value (untransformed parse * tree) */ char *cooked_default; /* nodeToString representation */ Index: src/test/regress/expected/alter_table.out =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/test/regress/expected/alter_table.out,v retrieving revision 1.48 diff -c -r1.48 alter_table.out *** src/test/regress/expected/alter_table.out 2002/08/04 05:11:37 1.48 --- src/test/regress/expected/alter_table.out 2002/08/26 20:31:06 *************** *** 883,891 **** alter table atacc1 alter "........pg.dropped.1........" drop not null; ERROR: Relation "atacc1" has no column "........pg.dropped.1........" alter table atacc1 rename a to x; ! ERROR: renameatt: attribute "a" does not exist alter table atacc1 rename "........pg.dropped.1........" to x; ! ERROR: renameatt: attribute "........pg.dropped.1........" does not exist alter table atacc1 add primary key(a); ERROR: ALTER TABLE: column "a" named in key does not exist alter table atacc1 add primary key("........pg.dropped.1........"); --- 883,891 ---- alter table atacc1 alter "........pg.dropped.1........" drop not null; ERROR: Relation "atacc1" has no column "........pg.dropped.1........" alter table atacc1 rename a to x; ! ERROR: ALTER TABLE: attribute "a" does not exist alter table atacc1 rename "........pg.dropped.1........" to x; ! ERROR: ALTER TABLE: attribute "........pg.dropped.1........" does not exist alter table atacc1 add primary key(a); ERROR: ALTER TABLE: column "a" named in key does not exist alter table atacc1 add primary key("........pg.dropped.1........"); *************** *** 1023,1025 **** --- 1023,1056 ---- (3 rows) drop table test; + -- test inheritance + create table dropColumn (a int, b int, e int); + create table dropColumnChild (c int) inherits (dropColumn); + create table dropColumnAnother (d int) inherits (dropColumnChild); + -- these two should fail + alter table dropColumnchild drop column a; + ERROR: ALTER TABLE: Cannot drop inherited column "a" from table "dropcolumnchild" + alter table only dropColumnChild drop column b; + ERROR: ALTER TABLE: Cannot drop inherited column "b" from table "dropcolumnchild" + -- these three should work + alter table only dropColumn drop column e; + alter table dropColumnChild drop column c; + alter table dropColumn drop column a; + create table renameColumn (a int); + create table renameColumnChild (b int) inherits (renameColumn); + create table renameColumnAnother (c int) inherits (renameColumnChild); + -- these three should fail + alter table renameColumnChild rename column a to d; + ERROR: ALTER TABLE: inherited attribute "a" may not be renamed + alter table only renameColumnChild rename column a to d; + ERROR: ALTER TABLE: Renaming of inherited attribute "a" forbidden + alter table only renameColumn rename column a to d; + ERROR: ALTER TABLE: Renaming of inherited attribute "a" forbidden + -- these should work + alter table renameColumn rename column a to d; + alter table renameColumnChild rename column b to a; + -- this should work + alter table renameColumn add column w int; + -- this should fail + alter table only renameColumn add column x int; + ERROR: ALTER TABLE: Cannot add an attribute to only inherited table Index: src/test/regress/expected/errors.out =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/test/regress/expected/errors.out,v retrieving revision 1.37 diff -c -r1.37 errors.out *** src/test/regress/expected/errors.out 2002/08/18 02:48:29 1.37 --- src/test/regress/expected/errors.out 2002/08/26 20:31:08 *************** *** 78,90 **** ERROR: Relation "nonesuchrel" does not exist -- no such attribute alter table emp rename column nonesuchatt to newnonesuchatt; ! ERROR: renameatt: attribute "nonesuchatt" does not exist -- conflict alter table emp rename column salary to manager; ! ERROR: renameatt: attribute "manager" exists -- conflict alter table emp rename column salary to oid; ! ERROR: renameatt: attribute "oid" exists -- -- TRANSACTION STUFF --- 78,90 ---- ERROR: Relation "nonesuchrel" does not exist -- no such attribute alter table emp rename column nonesuchatt to newnonesuchatt; ! ERROR: ALTER TABLE: attribute "nonesuchatt" does not exist -- conflict alter table emp rename column salary to manager; ! ERROR: ALTER TABLE: attribute "manager" exists -- conflict alter table emp rename column salary to oid; ! ERROR: ALTER TABLE: attribute "oid" exists -- -- TRANSACTION STUFF Index: src/test/regress/sql/alter_table.sql =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/test/regress/sql/alter_table.sql,v retrieving revision 1.31 diff -c -r1.31 alter_table.sql *** src/test/regress/sql/alter_table.sql 2002/08/04 04:28:10 1.31 --- src/test/regress/sql/alter_table.sql 2002/08/26 20:31:10 *************** *** 731,733 **** --- 731,766 ---- select * from test; drop table test; + -- test inheritance + + create table dropColumn (a int, b int, e int); + create table dropColumnChild (c int) inherits (dropColumn); + create table dropColumnAnother (d int) inherits (dropColumnChild); + + -- these two should fail + alter table dropColumnchild drop column a; + alter table only dropColumnChild drop column b; + + -- these three should work + alter table only dropColumn drop column e; + alter table dropColumnChild drop column c; + alter table dropColumn drop column a; + + create table renameColumn (a int); + create table renameColumnChild (b int) inherits (renameColumn); + create table renameColumnAnother (c int) inherits (renameColumnChild); + + -- these three should fail + alter table renameColumnChild rename column a to d; + alter table only renameColumnChild rename column a to d; + alter table only renameColumn rename column a to d; + + -- these should work + alter table renameColumn rename column a to d; + alter table renameColumnChild rename column b to a; + + -- this should work + alter table renameColumn add column w int; + + -- this should fail + alter table only renameColumn add column x int;