summaryrefslogtreecommitdiff
path: root/src/backend/catalog
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/catalog')
-rw-r--r--src/backend/catalog/aclchk.c44
-rw-r--r--src/backend/catalog/catalog.c18
-rw-r--r--src/backend/catalog/heap.c24
-rw-r--r--src/backend/catalog/index.c112
-rw-r--r--src/backend/catalog/indexing.c18
-rw-r--r--src/backend/catalog/pg_aggregate.c10
-rw-r--r--src/backend/catalog/pg_operator.c14
-rw-r--r--src/backend/catalog/pg_proc.c4
-rw-r--r--src/backend/catalog/pg_type.c16
9 files changed, 130 insertions, 130 deletions
diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index 45772f5e04..3d778d2609 100644
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.14 1998/08/19 02:01:27 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.15 1998/09/01 03:21:38 momjian Exp $
*
* NOTES
* See acl.h.
@@ -130,7 +130,7 @@ ChangeAcl(char *relname,
if (!heap_attisnull(tuple, Anum_pg_class_relacl))
old_acl = (Acl *) heap_getattr(tuple,
Anum_pg_class_relacl,
- RelationGetTupleDescriptor(relation),
+ RelationGetDescr(relation),
(bool *) NULL);
if (!old_acl || ACL_NUM(old_acl) < 1)
{
@@ -190,7 +190,7 @@ get_grosysid(char *groname)
id = ((Form_pg_group) GETSTRUCT(tuple))->grosysid;
else
elog(ERROR, "non-existent group \"%s\"", groname);
- return (id);
+ return id;
}
char *
@@ -206,7 +206,7 @@ get_groname(AclId grosysid)
name = (((Form_pg_group) GETSTRUCT(tuple))->groname).data;
else
elog(NOTICE, "get_groname: group %d not found", grosysid);
- return (name);
+ return name;
}
static int32
@@ -225,7 +225,7 @@ in_group(AclId uid, AclId gid)
{
elog(NOTICE, "in_group: could not open \"%s\"??",
GroupRelationName);
- return (0);
+ return 0;
}
tuple = SearchSysCacheTuple(GROSYSID,
ObjectIdGetDatum(gid),
@@ -235,7 +235,7 @@ in_group(AclId uid, AclId gid)
{
tmp = (IdList *) heap_getattr(tuple,
Anum_pg_group_grolist,
- RelationGetTupleDescriptor(relation),
+ RelationGetDescr(relation),
(bool *) NULL);
/* XXX make me a function */
num = IDLIST_NUM(tmp);
@@ -250,7 +250,7 @@ in_group(AclId uid, AclId gid)
else
elog(NOTICE, "in_group: group %d not found", gid);
heap_close(relation);
- return (found);
+ return found;
}
/*
@@ -300,7 +300,7 @@ aclcheck(char *relname, Acl *acl, AclId id, AclIdType idtype, AclMode mode)
elog(DEBUG, "aclcheck: found %d/%d",
aip->ai_id, aip->ai_mode);
#endif
- return ((aip->ai_mode & mode) ? ACLCHECK_OK : ACLCHECK_NO_PRIV);
+ return (aip->ai_mode & mode) ? ACLCHECK_OK : ACLCHECK_NO_PRIV;
}
}
for (found_group = 0;
@@ -340,7 +340,7 @@ aclcheck(char *relname, Acl *acl, AclId id, AclIdType idtype, AclMode mode)
elog(DEBUG, "aclcheck: found %d/%d",
aip->ai_id, aip->ai_mode);
#endif
- return ((aip->ai_mode & mode) ? ACLCHECK_OK : ACLCHECK_NO_PRIV);
+ return (aip->ai_mode & mode) ? ACLCHECK_OK : ACLCHECK_NO_PRIV;
}
}
break;
@@ -354,7 +354,7 @@ aclcheck(char *relname, Acl *acl, AclId id, AclIdType idtype, AclMode mode)
#ifdef ACLDEBUG_TRACE
elog(DEBUG, "aclcheck: using world=%d", aidat->ai_mode);
#endif
- return ((aidat->ai_mode & mode) ? ACLCHECK_OK : ACLCHECK_NO_PRIV);
+ return (aidat->ai_mode & mode) ? ACLCHECK_OK : ACLCHECK_NO_PRIV;
}
int32
@@ -433,7 +433,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
relation = heap_openr(RelationRelationName);
tmp = (Acl *) heap_getattr(tuple,
Anum_pg_class_relacl,
- RelationGetTupleDescriptor(relation),
+ RelationGetDescr(relation),
(bool *) NULL);
acl = makeacl(ACL_NUM(tmp));
memmove((char *) acl, (char *) tmp, ACL_SIZE(tmp));
@@ -451,7 +451,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
relation = heap_openr(RelationRelationName);
ownerId = (int4) heap_getattr(tuple,
Anum_pg_class_relowner,
- RelationGetTupleDescriptor(relation),
+ RelationGetDescr(relation),
(bool *) NULL);
acl = aclownerdefault(relname, (AclId)ownerId);
}
@@ -476,7 +476,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
{
tmp = (Acl *) heap_getattr(tuple,
Anum_pg_class_relacl,
- RelationGetTupleDescriptor(relation),
+ RelationGetDescr(relation),
(bool *) NULL);
acl = makeacl(ACL_NUM(tmp));
memmove((char *) acl, (char *) tmp, ACL_SIZE(tmp));
@@ -487,7 +487,7 @@ pg_aclcheck(char *relname, char *usename, AclMode mode)
result = aclcheck(relname, acl, id, (AclIdType) ACL_IDTYPE_UID, mode);
if (acl)
pfree(acl);
- return (result);
+ return result;
}
int32
@@ -516,7 +516,7 @@ pg_ownercheck(char *usename,
elog(DEBUG, "pg_ownercheck: user \"%s\" is superuser",
usename);
#endif
- return (1);
+ return 1;
}
tuple = SearchSysCacheTuple(cacheid, PointerGetDatum(value),
@@ -527,7 +527,7 @@ pg_ownercheck(char *usename,
if (!HeapTupleIsValid(tuple))
elog(ERROR, "pg_ownercheck: operator %ld not found",
PointerGetDatum(value));
- owner_id = ((OperatorTupleForm) GETSTRUCT(tuple))->oprowner;
+ owner_id = ((Form_pg_operator) GETSTRUCT(tuple))->oprowner;
break;
case PRONAME:
if (!HeapTupleIsValid(tuple))
@@ -545,7 +545,7 @@ pg_ownercheck(char *usename,
if (!HeapTupleIsValid(tuple))
elog(ERROR, "pg_ownercheck: type \"%s\" not found",
value);
- owner_id = ((TypeTupleForm) GETSTRUCT(tuple))->typowner;
+ owner_id = ((Form_pg_type) GETSTRUCT(tuple))->typowner;
break;
default:
elog(ERROR, "pg_ownercheck: invalid cache id: %d",
@@ -553,7 +553,7 @@ pg_ownercheck(char *usename,
break;
}
- return (user_id == owner_id);
+ return user_id == owner_id;
}
int32
@@ -583,7 +583,7 @@ pg_func_ownercheck(char *usename,
elog(DEBUG, "pg_ownercheck: user \"%s\" is superuser",
usename);
#endif
- return (1);
+ return 1;
}
tuple = SearchSysCacheTuple(PRONAME,
@@ -596,7 +596,7 @@ pg_func_ownercheck(char *usename,
owner_id = ((Form_pg_proc) GETSTRUCT(tuple))->proowner;
- return (user_id == owner_id);
+ return user_id == owner_id;
}
int32
@@ -625,7 +625,7 @@ pg_aggr_ownercheck(char *usename,
elog(DEBUG, "pg_aggr_ownercheck: user \"%s\" is superuser",
usename);
#endif
- return (1);
+ return 1;
}
tuple = SearchSysCacheTuple(AGGNAME,
@@ -638,5 +638,5 @@ pg_aggr_ownercheck(char *usename,
owner_id = ((Form_pg_aggregate) GETSTRUCT(tuple))->aggowner;
- return (user_id == owner_id);
+ return user_id == owner_id;
}
diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c
index 76dfa70630..5db4be0310 100644
--- a/src/backend/catalog/catalog.c
+++ b/src/backend/catalog/catalog.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.16 1998/08/19 02:01:29 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/catalog.c,v 1.17 1998/09/01 03:21:40 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -27,7 +27,7 @@
* Perhaps this should be in-line code in relopen().
*/
char *
-relpath(char relname[])
+relpath(char *relname)
{
char *path;
@@ -35,9 +35,9 @@ relpath(char relname[])
{
path = (char *) palloc(strlen(DataDir) + sizeof(NameData) + 2);
sprintf(path, "%s/%s", DataDir, relname);
- return (path);
+ return path;
}
- return (relname);
+ return relname;
}
#ifdef NOT_USED
@@ -51,7 +51,7 @@ relpath(char relname[])
* XXX this is way bogus. -- pma
*/
bool
-issystem(char relname[])
+issystem(char *relname)
{
if (relname[0] && relname[1] && relname[2])
return (relname[0] == 'p' &&
@@ -154,12 +154,12 @@ newoid()
void
fillatt(TupleDesc tupleDesc)
{
- AttributeTupleForm *attributeP;
- TypeTupleForm typp;
+ Form_pg_attribute *attributeP;
+ Form_pg_type typp;
HeapTuple tuple;
int i;
int natts = tupleDesc->natts;
- AttributeTupleForm *att = tupleDesc->attrs;
+ Form_pg_attribute *att = tupleDesc->attrs;
if (natts < 0 || natts > MaxHeapAttributeNumber)
elog(ERROR, "fillatt: %d attributes is too large", natts);
@@ -193,7 +193,7 @@ fillatt(TupleDesc tupleDesc)
*/
if (!(*attributeP)->attisset)
{
- typp = (TypeTupleForm) GETSTRUCT(tuple); /* XXX */
+ typp = (Form_pg_type) GETSTRUCT(tuple); /* XXX */
(*attributeP)->attlen = typp->typlen;
(*attributeP)->attbyval = typp->typbyval;
}
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index d4212f631f..d6c252f7ba 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.62 1998/08/29 04:19:08 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.63 1998/09/01 03:21:41 momjian Exp $
*
* INTERFACE ROUTINES
* heap_create() - Create an uncataloged heap relation
@@ -73,7 +73,7 @@ static void AddToTempRelList(Relation r);
static void DeletePgAttributeTuples(Relation rel);
static void DeletePgRelationTuple(Relation rel);
static void DeletePgTypeTuple(Relation rel);
-static int RelationAlreadyExists(Relation pg_class_desc, char relname[]);
+static int RelationAlreadyExists(Relation pg_class_desc, char *relname);
static void RelationRemoveIndexes(Relation relation);
static void RelationRemoveInheritance(Relation relation);
static void RemoveFromTempRelList(Relation r);
@@ -129,7 +129,7 @@ static FormData_pg_attribute a6 = {
MaxCommandIdAttributeNumber, 0, -1, -1, '\001', '\0', 'i', '\0', '\0'
};
-static AttributeTupleForm HeapAtt[] =
+static Form_pg_attribute HeapAtt[] =
{&a1, &a2, &a3, &a4, &a5, &a6};
/* ----------------------------------------------------------------
@@ -185,7 +185,7 @@ heap_create(char *name,
int isTemp = 0;
int natts = tupDesc->natts;
-/* AttributeTupleForm *att = tupDesc->attrs; */
+/* Form_pg_attribute *att = tupDesc->attrs; */
extern GlobalMemory CacheCxt;
MemoryContext oldcxt;
@@ -332,7 +332,7 @@ heap_create(char *name,
if (isTemp)
AddToTempRelList(rel);
- return (rel);
+ return rel;
}
@@ -465,7 +465,7 @@ CheckAttributeNames(TupleDesc tupdesc)
* --------------------------------
*/
static int
-RelationAlreadyExists(Relation pg_class_desc, char relname[])
+RelationAlreadyExists(Relation pg_class_desc, char *relname)
{
ScanKeyData key;
HeapScanDesc pg_class_scan;
@@ -535,7 +535,7 @@ static void
AddNewAttributeTuples(Oid new_rel_oid,
TupleDesc tupdesc)
{
- AttributeTupleForm *dpp;
+ Form_pg_attribute *dpp;
unsigned i;
HeapTuple tup;
Relation rel;
@@ -555,7 +555,7 @@ AddNewAttributeTuples(Oid new_rel_oid,
*/
Assert(rel);
Assert(rel->rd_rel);
- hasindex = RelationGetRelationTupleForm(rel)->relhasindex;
+ hasindex = RelationGetForm(rel)->relhasindex;
if (hasindex)
CatalogOpenIndices(Num_pg_attr_indices, Name_pg_attr_indices, idescs);
@@ -911,7 +911,7 @@ RelationRemoveInheritance(Relation relation)
heap_close(catalogRelation);
elog(ERROR, "relation <%d> inherits \"%s\"",
- ((InheritsTupleForm) GETSTRUCT(tuple))->inhrel,
+ ((Form_pg_inherits) GETSTRUCT(tuple))->inhrel,
RelationGetRelationName(relation));
}
@@ -984,7 +984,7 @@ RelationRemoveIndexes(Relation relation)
&entry);
while (HeapTupleIsValid(tuple = heap_getnext(scan, 0)))
- index_destroy(((IndexTupleForm) GETSTRUCT(tuple))->indexrelid);
+ index_destroy(((Form_pg_index) GETSTRUCT(tuple))->indexrelid);
heap_endscan(scan);
heap_close(indexRelation);
@@ -1165,7 +1165,7 @@ DeletePgTypeTuple(Relation rel)
if (HeapTupleIsValid(atttup))
{
- Oid relid = ((AttributeTupleForm) GETSTRUCT(atttup))->attrelid;
+ Oid relid = ((Form_pg_attribute) GETSTRUCT(atttup))->attrelid;
heap_endscan(pg_type_scan);
heap_close(pg_type_desc);
@@ -1428,7 +1428,7 @@ StoreAttrDefault(Relation rel, AttrDefault *attrdef)
{
char str[MAX_PARSE_BUFFER];
char cast[2 * NAMEDATALEN] = {0};
- AttributeTupleForm atp = rel->rd_att->attrs[attrdef->adnum - 1];
+ Form_pg_attribute atp = rel->rd_att->attrs[attrdef->adnum - 1];
QueryTreeList *queryTree_list;
Query *query;
List *planTree_list;
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 260f29d98c..ad8725a254 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.58 1998/08/31 17:49:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.59 1998/09/01 03:21:43 momjian Exp $
*
*
* INTERFACE ROUTINES
@@ -71,7 +71,7 @@ static TupleDesc BuildFuncTupleDesc(FuncIndexInfo *funcInfo);
static TupleDesc
ConstructTupleDescriptor(Oid heapoid, Relation heapRelation,
List *attributeList,
- int numatts, AttrNumber attNums[]);
+ int numatts, AttrNumber *attNums);
static void ConstructIndexReldesc(Relation indexRelation, Oid amoid);
static Oid UpdateRelationRelation(Relation indexRelation);
@@ -84,13 +84,13 @@ static void
static void
UpdateIndexRelation(Oid indexoid, Oid heapoid,
FuncIndexInfo *funcInfo, int natts,
- AttrNumber attNums[], Oid classOids[], Node *predicate,
+ AttrNumber *attNums, Oid *classOids, Node *predicate,
List *attributeList, bool islossy, bool unique);
static void
DefaultBuild(Relation heapRelation, Relation indexRelation,
- int numberOfAttributes, AttrNumber attributeNumber[],
+ int numberOfAttributes, AttrNumber *attributeNumber,
IndexStrategy indexStrategy, uint16 parameterCount,
- Datum parameter[], FuncIndexInfoPtr funcInfo, PredInfo *predInfo);
+ Datum *parameter, FuncIndexInfoPtr funcInfo, PredInfo *predInfo);
/* ----------------------------------------------------------------
* sysatts is a structure containing attribute tuple forms
@@ -241,7 +241,7 @@ BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
* Allocate and zero a tuple descriptor.
*/
funcTupDesc = CreateTemplateTupleDesc(1);
- funcTupDesc->attrs[0] = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE);
+ funcTupDesc->attrs[0] = (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
MemSet(funcTupDesc->attrs[0], 0, ATTRIBUTE_TUPLE_SIZE);
/*
@@ -273,20 +273,20 @@ BuildFuncTupleDesc(FuncIndexInfo *funcInfo)
/*
* Assign some of the attributes values. Leave the rest as 0.
*/
- funcTupDesc->attrs[0]->attlen = ((TypeTupleForm) GETSTRUCT(tuple))->typlen;
+ funcTupDesc->attrs[0]->attlen = ((Form_pg_type) GETSTRUCT(tuple))->typlen;
funcTupDesc->attrs[0]->atttypid = retType;
funcTupDesc->attrs[0]->attnum = 1;
- funcTupDesc->attrs[0]->attbyval = ((TypeTupleForm) GETSTRUCT(tuple))->typbyval;
+ funcTupDesc->attrs[0]->attbyval = ((Form_pg_type) GETSTRUCT(tuple))->typbyval;
funcTupDesc->attrs[0]->attcacheoff = -1;
funcTupDesc->attrs[0]->atttypmod = -1;
- funcTupDesc->attrs[0]->attalign = ((TypeTupleForm) GETSTRUCT(tuple))->typalign;
+ funcTupDesc->attrs[0]->attalign = ((Form_pg_type) GETSTRUCT(tuple))->typalign;
/*
* make the attributes name the same as the functions
*/
namestrcpy(&funcTupDesc->attrs[0]->attname, funcname);
- return (funcTupDesc);
+ return funcTupDesc;
}
/* ----------------------------------------------------------------
@@ -298,7 +298,7 @@ ConstructTupleDescriptor(Oid heapoid,
Relation heapRelation,
List *attributeList,
int numatts,
- AttrNumber attNums[])
+ AttrNumber *attNums)
{
TupleDesc heapTupDesc;
TupleDesc indexTupDesc;
@@ -306,7 +306,7 @@ ConstructTupleDescriptor(Oid heapoid,
TypeName *IndexKeyType;
AttrNumber atnum; /* attributeNumber[attributeOffset] */
AttrNumber atind;
- int natts; /* RelationTupleForm->relnatts */
+ int natts; /* Form_pg_class->relnatts */
char *from; /* used to simplify memcpy below */
char *to; /* used to simplify memcpy below */
int i;
@@ -315,7 +315,7 @@ ConstructTupleDescriptor(Oid heapoid,
* allocate the new tuple descriptor
* ----------------
*/
- natts = RelationGetRelationTupleForm(heapRelation)->relnatts;
+ natts = RelationGetForm(heapRelation)->relnatts;
indexTupDesc = CreateTemplateTupleDesc(numatts);
@@ -350,7 +350,7 @@ ConstructTupleDescriptor(Oid heapoid,
else
IndexKeyType = NULL;
- indexTupDesc->attrs[i] = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE);
+ indexTupDesc->attrs[i] = (Form_pg_attribute) palloc(ATTRIBUTE_TUPLE_SIZE);
/* ----------------
* determine which tuple descriptor to copy
@@ -379,7 +379,7 @@ ConstructTupleDescriptor(Oid heapoid,
* here we are indexing on a normal attribute (1...n)
* ----------------
*/
- heapTupDesc = RelationGetTupleDescriptor(heapRelation);
+ heapTupDesc = RelationGetDescr(heapRelation);
atind = AttrNumberGetAttrOffset(atnum);
from = (char *) (heapTupDesc->attrs[atind]);
@@ -394,13 +394,13 @@ ConstructTupleDescriptor(Oid heapoid,
to = (char *) (indexTupDesc->attrs[i]);
memcpy(to, from, ATTRIBUTE_TUPLE_SIZE);
- ((AttributeTupleForm) to)->attnum = i + 1;
+ ((Form_pg_attribute) to)->attnum = i + 1;
- ((AttributeTupleForm) to)->attnotnull = false;
- ((AttributeTupleForm) to)->atthasdef = false;
- ((AttributeTupleForm) to)->attcacheoff = -1;
- ((AttributeTupleForm) to)->atttypmod = -1;
- ((AttributeTupleForm) to)->attalign = 'i';
+ ((Form_pg_attribute) to)->attnotnull = false;
+ ((Form_pg_attribute) to)->atthasdef = false;
+ ((Form_pg_attribute) to)->attcacheoff = -1;
+ ((Form_pg_attribute) to)->atttypmod = -1;
+ ((Form_pg_attribute) to)->attalign = 'i';
/*
* if the keytype is defined, we need to change the tuple form's
@@ -416,14 +416,14 @@ ConstructTupleDescriptor(Oid heapoid,
if (!HeapTupleIsValid(tup))
elog(ERROR, "create index: type '%s' undefined",
IndexKeyType->name);
- ((AttributeTupleForm) to)->atttypid = tup->t_oid;
- ((AttributeTupleForm) to)->attbyval =
- ((TypeTupleForm) GETSTRUCT(tup))->typbyval;
- ((AttributeTupleForm) to)->attlen =
- ((TypeTupleForm) GETSTRUCT(tup))->typlen;
- ((AttributeTupleForm) to)->attalign =
- ((TypeTupleForm) GETSTRUCT(tup))->typalign;
- ((AttributeTupleForm) to)->atttypmod = IndexKeyType->typmod;
+ ((Form_pg_attribute) to)->atttypid = tup->t_oid;
+ ((Form_pg_attribute) to)->attbyval =
+ ((Form_pg_type) GETSTRUCT(tup))->typbyval;
+ ((Form_pg_attribute) to)->attlen =
+ ((Form_pg_type) GETSTRUCT(tup))->typlen;
+ ((Form_pg_attribute) to)->attalign =
+ ((Form_pg_type) GETSTRUCT(tup))->typalign;
+ ((Form_pg_attribute) to)->atttypmod = IndexKeyType->typmod;
}
@@ -433,14 +433,14 @@ ConstructTupleDescriptor(Oid heapoid,
* all set.
* ----------------
*/
- ((AttributeTupleForm) to)->attrelid = heapoid;
+ ((Form_pg_attribute) to)->attrelid = heapoid;
}
return indexTupDesc;
}
/* ----------------------------------------------------------------
- * AccessMethodObjectIdGetAccessMethodTupleForm --
+ * AccessMethodObjectIdGetForm --
* Returns the formated access method tuple given its object identifier.
*
* XXX ADD INDEXING
@@ -450,7 +450,7 @@ ConstructTupleDescriptor(Oid heapoid,
* ----------------------------------------------------------------
*/
Form_pg_am
-AccessMethodObjectIdGetAccessMethodTupleForm(Oid accessMethodObjectId)
+AccessMethodObjectIdGetForm(Oid accessMethodObjectId)
{
Relation pg_am_desc;
HeapScanDesc pg_am_scan;
@@ -483,7 +483,7 @@ AccessMethodObjectIdGetAccessMethodTupleForm(Oid accessMethodObjectId)
{
heap_endscan(pg_am_scan);
heap_close(pg_am_desc);
- return (NULL);
+ return NULL;
}
/* ----------------
@@ -496,7 +496,7 @@ AccessMethodObjectIdGetAccessMethodTupleForm(Oid accessMethodObjectId)
heap_endscan(pg_am_scan);
heap_close(pg_am_desc);
- return (form);
+ return form;
}
/* ----------------------------------------------------------------
@@ -521,7 +521,7 @@ ConstructIndexReldesc(Relation indexRelation, Oid amoid)
oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
indexRelation->rd_am =
- AccessMethodObjectIdGetAccessMethodTupleForm(amoid);
+ AccessMethodObjectIdGetForm(amoid);
MemoryContextSwitchTo(oldcxt);
@@ -583,7 +583,7 @@ UpdateRelationRelation(Relation indexRelation)
pfree(tuple);
heap_close(pg_class);
- return (tupleOid);
+ return tupleOid;
}
/* ----------------------------------------------------------------
@@ -598,7 +598,7 @@ InitializeAttributeOids(Relation indexRelation,
TupleDesc tupleDescriptor;
int i;
- tupleDescriptor = RelationGetTupleDescriptor(indexRelation);
+ tupleDescriptor = RelationGetDescr(indexRelation);
for (i = 0; i < numatts; i += 1)
tupleDescriptor->attrs[i]->attrelid = indexoid;
@@ -633,7 +633,7 @@ AppendAttributeTuples(Relation indexRelation, int numatts)
pg_attribute = heap_openr(AttributeRelationName);
/* ----------------
- * initialize null[], replace[] and value[]
+ * initialize *null, *replace and *value
* ----------------
*/
MemSet(nullv, ' ', Natts_pg_attribute);
@@ -681,7 +681,7 @@ AppendAttributeTuples(Relation indexRelation, int numatts)
* descriptor to form the remaining attribute tuples.
* ----------------
*/
- indexTupDesc = RelationGetTupleDescriptor(indexRelation);
+ indexTupDesc = RelationGetDescr(indexRelation);
for (i = 1; i < numatts; i += 1)
{
@@ -731,14 +731,14 @@ UpdateIndexRelation(Oid indexoid,
Oid heapoid,
FuncIndexInfo *funcInfo,
int natts,
- AttrNumber attNums[],
- Oid classOids[],
+ AttrNumber *attNums,
+ Oid *classOids,
Node *predicate,
List *attributeList,
bool islossy,
bool unique)
{
- IndexTupleForm indexForm;
+ Form_pg_index indexForm;
IndexElem *IndexKey;
char *predString;
text *predText;
@@ -749,7 +749,7 @@ UpdateIndexRelation(Oid indexoid,
int i;
/* ----------------
- * allocate an IndexTupleForm big enough to hold the
+ * allocate an Form_pg_index big enough to hold the
* index-predicate (if any) in string form
* ----------------
*/
@@ -763,7 +763,7 @@ UpdateIndexRelation(Oid indexoid,
predText = (text *) fmgr(F_TEXTIN, "");
predLen = VARSIZE(predText);
itupLen = predLen + sizeof(FormData_pg_index);
- indexForm = (IndexTupleForm) palloc(itupLen);
+ indexForm = (Form_pg_index) palloc(itupLen);
memmove((char *) &indexForm->indpred, (char *) predText, predLen);
@@ -1009,8 +1009,8 @@ index_create(char *heapRelationName,
List *attributeList,
Oid accessMethodObjectId,
int numatts,
- AttrNumber attNums[],
- Oid classObjectId[],
+ AttrNumber *attNums,
+ Oid *classObjectId,
uint16 parameterCount,
Datum *parameter,
Node *predicate,
@@ -1259,7 +1259,7 @@ index_destroy(Oid indexId)
*/
void
FormIndexDatum(int numberOfAttributes,
- AttrNumber attributeNumber[],
+ AttrNumber *attributeNumber,
HeapTuple heapTuple,
TupleDesc heapDescriptor,
Datum *datum,
@@ -1475,10 +1475,10 @@ static void
DefaultBuild(Relation heapRelation,
Relation indexRelation,
int numberOfAttributes,
- AttrNumber attributeNumber[],
+ AttrNumber *attributeNumber,
IndexStrategy indexStrategy, /* not used */
uint16 parameterCount, /* not used */
- Datum parameter[], /* not used */
+ Datum *parameter, /* not used */
FuncIndexInfoPtr funcInfo,
PredInfo *predInfo)
{
@@ -1514,8 +1514,8 @@ DefaultBuild(Relation heapRelation,
* how to form the index tuples..
* ----------------
*/
- heapDescriptor = RelationGetTupleDescriptor(heapRelation);
- indexDescriptor = RelationGetTupleDescriptor(indexRelation);
+ heapDescriptor = RelationGetDescr(heapRelation);
+ indexDescriptor = RelationGetDescr(indexRelation);
/* ----------------
* datum and null are arrays in which we collect the index attributes
@@ -1675,7 +1675,7 @@ void
index_build(Relation heapRelation,
Relation indexRelation,
int numberOfAttributes,
- AttrNumber attributeNumber[],
+ AttrNumber *attributeNumber,
uint16 parameterCount,
Datum *parameter,
FuncIndexInfo *funcInfo,
@@ -1727,7 +1727,7 @@ bool
IndexIsUnique(Oid indexId)
{
HeapTuple tuple;
- IndexTupleForm index;
+ Form_pg_index index;
tuple = SearchSysCacheTuple(INDEXRELID,
ObjectIdGetDatum(indexId),
@@ -1737,7 +1737,7 @@ IndexIsUnique(Oid indexId)
elog(ERROR, "IndexIsUnique: can't find index id %d",
indexId);
}
- index = (IndexTupleForm) GETSTRUCT(tuple);
+ index = (Form_pg_index) GETSTRUCT(tuple);
Assert(index->indexrelid == indexId);
return index->indisunique;
@@ -1762,7 +1762,7 @@ IndexIsUniqueNoCache(Oid indexId)
ScanKeyData skey[1];
HeapScanDesc scandesc;
HeapTuple tuple;
- IndexTupleForm index;
+ Form_pg_index index;
bool isunique;
pg_index = heap_openr(IndexRelationName);
@@ -1779,7 +1779,7 @@ IndexIsUniqueNoCache(Oid indexId)
if (!HeapTupleIsValid(tuple))
elog(ERROR, "IndexIsUniqueNoCache: can't find index id %d", indexId);
- index = (IndexTupleForm) GETSTRUCT(tuple);
+ index = (Form_pg_index) GETSTRUCT(tuple);
Assert(index->indexrelid == indexId);
isunique = index->indisunique;
diff --git a/src/backend/catalog/indexing.c b/src/backend/catalog/indexing.c
index 86a3c0d68b..8fa94148c0 100644
--- a/src/backend/catalog/indexing.c
+++ b/src/backend/catalog/indexing.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.24 1998/08/31 17:49:17 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.25 1998/09/01 03:21:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -74,7 +74,7 @@ static HeapTuple CatalogIndexFetchTuple(Relation heapRelation,
* associated with them.
*/
void
-CatalogOpenIndices(int nIndices, char *names[], Relation idescs[])
+CatalogOpenIndices(int nIndices, char **names, Relation *idescs)
{
int i;
@@ -108,7 +108,7 @@ CatalogIndexInsert(Relation *idescs,
{
HeapTuple pgIndexTup;
TupleDesc heapDescriptor;
- IndexTupleForm pgIndexP;
+ Form_pg_index pgIndexP;
Datum datum;
int natts;
AttrNumber *attnumP;
@@ -117,19 +117,19 @@ CatalogIndexInsert(Relation *idescs,
char nulls[INDEX_MAX_KEYS];
int i;
- heapDescriptor = RelationGetTupleDescriptor(heapRelation);
+ heapDescriptor = RelationGetDescr(heapRelation);
for (i = 0; i < nIndices; i++)
{
TupleDesc indexDescriptor;
InsertIndexResult indexRes;
- indexDescriptor = RelationGetTupleDescriptor(idescs[i]);
+ indexDescriptor = RelationGetDescr(idescs[i]);
pgIndexTup = SearchSysCacheTupleCopy(INDEXRELID,
ObjectIdGetDatum(idescs[i]->rd_id),
0, 0, 0);
Assert(pgIndexTup);
- pgIndexP = (IndexTupleForm) GETSTRUCT(pgIndexTup);
+ pgIndexP = (Form_pg_index) GETSTRUCT(pgIndexTup);
/*
* Compute the number of attributes we are indexing upon.
@@ -191,9 +191,9 @@ CatalogHasIndex(char *catName, Oid catId)
for (i = 0; IndexedCatalogNames[i] != NULL; i++)
{
if (strcmp(IndexedCatalogNames[i], catName) == 0)
- return (true);
+ return true;
}
- return (false);
+ return false;
}
pg_class = heap_openr(RelationRelationName);
@@ -207,7 +207,7 @@ CatalogHasIndex(char *catName, Oid catId)
}
pgRelP = (Form_pg_class) GETSTRUCT(htup);
- return (pgRelP->relhasindex);
+ return pgRelP->relhasindex;
}
/*
diff --git a/src/backend/catalog/pg_aggregate.c b/src/backend/catalog/pg_aggregate.c
index 045bdd002f..c9370df540 100644
--- a/src/backend/catalog/pg_aggregate.c
+++ b/src/backend/catalog/pg_aggregate.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.15 1998/08/19 02:01:34 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_aggregate.c,v 1.16 1998/09/01 03:21:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -314,14 +314,14 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
* NULL
*/
textInitVal = (text *) fastgetattr(tup, initValAttno,
- RelationGetTupleDescriptor(aggRel),
+ RelationGetDescr(aggRel),
isNull);
if (!PointerIsValid(textInitVal))
*isNull = true;
if (*isNull)
{
heap_close(aggRel);
- return ((char *) NULL);
+ return (char *) NULL;
}
strInitVal = textout(textInitVal);
heap_close(aggRel);
@@ -334,7 +334,7 @@ AggNameGetInitVal(char *aggName, Oid basetype, int xfuncno, bool *isNull)
pfree(strInitVal);
elog(ERROR, "AggNameGetInitVal: cache lookup failed on aggregate transition function return type");
}
- initVal = fmgr(((TypeTupleForm) GETSTRUCT(tup))->typinput, strInitVal, -1);
+ initVal = fmgr(((Form_pg_type) GETSTRUCT(tup))->typinput, strInitVal, -1);
pfree(strInitVal);
- return (initVal);
+ return initVal;
}
diff --git a/src/backend/catalog/pg_operator.c b/src/backend/catalog/pg_operator.c
index 22209ec1f3..a2123fc7c5 100644
--- a/src/backend/catalog/pg_operator.c
+++ b/src/backend/catalog/pg_operator.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.27 1998/08/19 02:01:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_operator.c,v 1.28 1998/09/01 03:21:47 momjian Exp $
*
* NOTES
* these routines moved here from commands/define.c and somewhat cleaned up.
@@ -234,7 +234,7 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
TupleDesc tupDesc;
/* ----------------
- * initialize our nulls[] and values[] arrays
+ * initialize our *nulls and *values arrays
* ----------------
*/
for (i = 0; i < Natts_pg_operator; ++i)
@@ -244,7 +244,7 @@ OperatorShellMakeWithOpenRelation(Relation pg_operator_desc,
}
/* ----------------
- * initialize values[] with the type name and
+ * initialize *values with the type name and
* ----------------
*/
i = 0;
@@ -807,9 +807,9 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
{
if (HeapTupleIsValid(tup))
{
- OperatorTupleForm t;
+ Form_pg_operator t;
- t = (OperatorTupleForm) GETSTRUCT(tup);
+ t = (Form_pg_operator) GETSTRUCT(tup);
if (!OidIsValid(t->oprcom)
|| !OidIsValid(t->oprnegate))
{
@@ -849,7 +849,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
/* if commutator and negator are different, do two updates */
if (HeapTupleIsValid(tup) &&
- !(OidIsValid(((OperatorTupleForm) GETSTRUCT(tup))->oprcom)))
+ !(OidIsValid(((Form_pg_operator) GETSTRUCT(tup))->oprcom)))
{
values[Anum_pg_operator_oprcom - 1] = ObjectIdGetDatum(baseId);
replaces[Anum_pg_operator_oprcom - 1] = 'r';
@@ -878,7 +878,7 @@ OperatorUpd(Oid baseId, Oid commId, Oid negId)
tup = heap_getnext(pg_operator_scan, 0);
if (HeapTupleIsValid(tup) &&
- !(OidIsValid(((OperatorTupleForm) GETSTRUCT(tup))->oprnegate)))
+ !(OidIsValid(((Form_pg_operator) GETSTRUCT(tup))->oprnegate)))
{
values[Anum_pg_operator_oprnegate - 1] = ObjectIdGetDatum(baseId);
replaces[Anum_pg_operator_oprnegate - 1] = 'r';
diff --git a/src/backend/catalog/pg_proc.c b/src/backend/catalog/pg_proc.c
index 2e83652ac8..006286f6f7 100644
--- a/src/backend/catalog/pg_proc.c
+++ b/src/backend/catalog/pg_proc.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.21 1998/08/31 17:49:18 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.22 1998/09/01 03:21:48 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -266,7 +266,7 @@ ProcedureCreate(char *procedureName,
heap_insert(rel, tup);
- if (RelationGetRelationTupleForm(rel)->relhasindex)
+ if (RelationGetForm(rel)->relhasindex)
{
Relation idescs[Num_pg_proc_indices];
diff --git a/src/backend/catalog/pg_type.c b/src/backend/catalog/pg_type.c
index 999a398db6..3375cfe591 100644
--- a/src/backend/catalog/pg_type.c
+++ b/src/backend/catalog/pg_type.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.28 1998/08/20 22:07:37 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.29 1998/09/01 03:21:49 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -98,7 +98,7 @@ TypeGetWithOpenRelation(Relation pg_type_desc,
* ----------------
*/
heap_endscan(scan);
- *defined = (bool) ((TypeTupleForm) GETSTRUCT(tup))->typisdefined;
+ *defined = (bool) ((Form_pg_type) GETSTRUCT(tup))->typisdefined;
return tup->t_oid;
}
@@ -163,7 +163,7 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
TupleDesc tupDesc;
/* ----------------
- * initialize our nulls[] and values[] arrays
+ * initialize our *nulls and *values arrays
* ----------------
*/
for (i = 0; i < Natts_pg_type; ++i)
@@ -173,7 +173,7 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
}
/* ----------------
- * initialize values[] with the type name and
+ * initialize *values with the type name and
* ----------------
*/
i = 0;
@@ -215,7 +215,7 @@ TypeShellMakeWithOpenRelation(Relation pg_type_desc, char *typeName)
heap_insert(pg_type_desc, tup);
typoid = tup->t_oid;
- if (RelationGetRelationTupleForm(pg_type_desc)->relhasindex)
+ if (RelationGetForm(pg_type_desc)->relhasindex)
{
Relation idescs[Num_pg_type_indices];
@@ -375,7 +375,7 @@ TypeCreate(char *typeName,
internalSize = -1;
/* ----------------
- * initialize the values[] information
+ * initialize the *values information
* ----------------
*/
i = 0;
@@ -509,7 +509,7 @@ TypeCreate(char *typeName,
*/
heap_endscan(pg_type_scan);
- if (RelationGetRelationTupleForm(pg_type_desc)->relhasindex)
+ if (RelationGetForm(pg_type_desc)->relhasindex)
{
Relation idescs[Num_pg_type_indices];
@@ -558,7 +558,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
elog(ERROR, "TypeRename: type %s already defined", newTypeName);
}
- namestrcpy(&(((TypeTupleForm) GETSTRUCT(oldtup))->typname), newTypeName);
+ namestrcpy(&(((Form_pg_type) GETSTRUCT(oldtup))->typname), newTypeName);
setheapoverride(true);
heap_replace(pg_type_desc, &oldtup->t_ctid, oldtup);