mirror of
https://github.com/postgres/postgres.git
synced 2025-11-13 16:22:44 +03:00
Remove un-needed braces around single statements.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.10 1998/05/09 23:42:58 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/aclchk.c,v 1.11 1998/06/15 19:28:06 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* See acl.h.
|
||||
@@ -200,13 +200,9 @@ get_grosysid(char *groname)
|
||||
htp = SearchSysCacheTuple(GRONAME, PointerGetDatum(groname),
|
||||
0, 0, 0);
|
||||
if (HeapTupleIsValid(htp))
|
||||
{
|
||||
id = ((Form_pg_group) GETSTRUCT(htp))->grosysid;
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "non-existent group \"%s\"", groname);
|
||||
}
|
||||
return (id);
|
||||
}
|
||||
|
||||
@@ -219,13 +215,9 @@ get_groname(AclId grosysid)
|
||||
htp = SearchSysCacheTuple(GROSYSID, PointerGetDatum(grosysid),
|
||||
0, 0, 0);
|
||||
if (HeapTupleIsValid(htp))
|
||||
{
|
||||
name = (((Form_pg_group) GETSTRUCT(htp))->groname).data;
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(NOTICE, "get_groname: group %d not found", grosysid);
|
||||
}
|
||||
return (name);
|
||||
}
|
||||
|
||||
@@ -267,9 +259,7 @@ in_group(AclId uid, AclId gid)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(NOTICE, "in_group: group %d not found", gid);
|
||||
}
|
||||
heap_close(relation);
|
||||
return (found);
|
||||
}
|
||||
@@ -290,9 +280,7 @@ aclcheck(char *relname, Acl *acl, AclId id, AclIdType idtype, AclMode mode)
|
||||
|
||||
/* if no acl is found, use world default */
|
||||
if (!acl)
|
||||
{
|
||||
acl = acldefault(relname);
|
||||
}
|
||||
|
||||
num = ACL_NUM(acl);
|
||||
aidat = ACL_DAT(acl);
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.50 1998/06/14 13:31:07 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.51 1998/06/15 19:28:07 momjian Exp $
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
* heap_create() - Create an uncataloged heap relation
|
||||
@@ -291,9 +291,7 @@ heap_create(char *name,
|
||||
rdesc->rd_rel->relchecks = tupDesc->constr->num_check;
|
||||
|
||||
for (i = 0; i < natts; i++)
|
||||
{
|
||||
rdesc->rd_att->attrs[i]->attrelid = relid;
|
||||
}
|
||||
|
||||
rdesc->rd_id = relid;
|
||||
|
||||
@@ -933,9 +931,7 @@ RelationRemoveInheritance(Relation relation)
|
||||
{
|
||||
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
break;
|
||||
}
|
||||
heap_delete(catalogRelation, &tuple->t_ctid);
|
||||
}
|
||||
|
||||
@@ -961,9 +957,7 @@ RelationRemoveInheritance(Relation relation)
|
||||
{
|
||||
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
break;
|
||||
}
|
||||
heap_delete(catalogRelation, &tuple->t_ctid);
|
||||
}
|
||||
|
||||
@@ -1000,9 +994,7 @@ RelationRemoveIndexes(Relation relation)
|
||||
{
|
||||
tuple = heap_getnext(scan, 0, (Buffer *) NULL);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
index_destroy(((IndexTupleForm) GETSTRUCT(tuple))->indexrelid);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.42 1998/06/13 20:22:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/index.c,v 1.43 1998/06/15 19:28:09 momjian Exp $
|
||||
*
|
||||
*
|
||||
* INTERFACE ROUTINES
|
||||
@@ -190,9 +190,7 @@ RelationNameGetObjectId(char *relationName,
|
||||
pg_class_tuple = heap_getnext(pg_class_scan, 0, &buffer);
|
||||
|
||||
if (!HeapTupleIsValid(pg_class_tuple))
|
||||
{
|
||||
relationObjectId = InvalidOid;
|
||||
}
|
||||
else
|
||||
{
|
||||
relationObjectId = pg_class_tuple->t_oid;
|
||||
@@ -385,9 +383,7 @@ ConstructTupleDescriptor(Oid heapoid,
|
||||
IndexKeyType = IndexKey->tname;
|
||||
}
|
||||
else
|
||||
{
|
||||
IndexKeyType = NULL;
|
||||
}
|
||||
|
||||
indexTupDesc->attrs[i] = (AttributeTupleForm) palloc(ATTRIBUTE_TUPLE_SIZE);
|
||||
|
||||
@@ -805,9 +801,7 @@ UpdateIndexRelation(Oid indexoid,
|
||||
pfree(predString);
|
||||
}
|
||||
else
|
||||
{
|
||||
predText = (text *) fmgr(F_TEXTIN, "");
|
||||
}
|
||||
predLen = VARSIZE(predText);
|
||||
itupLen = predLen + sizeof(FormData_pg_index);
|
||||
indexForm = (IndexTupleForm) palloc(itupLen);
|
||||
@@ -942,9 +936,7 @@ UpdateIndexPredicate(Oid indexoid, Node *oldPred, Node *predicate)
|
||||
pfree(predString);
|
||||
}
|
||||
else
|
||||
{
|
||||
predText = (text *) fmgr(F_TEXTIN, "");
|
||||
}
|
||||
|
||||
/* open the index system catalog relation */
|
||||
pg_index = heap_openr(IndexRelationName);
|
||||
@@ -1027,9 +1019,7 @@ InitIndexStrategy(int numatts,
|
||||
strsize);
|
||||
}
|
||||
else
|
||||
{
|
||||
support = (RegProcedure *) NULL;
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* fill in the index strategy structure with information
|
||||
@@ -1269,9 +1259,7 @@ index_destroy(Oid indexId)
|
||||
|
||||
while (tuple = heap_getnext(scan, 0, (Buffer *) NULL),
|
||||
HeapTupleIsValid(tuple))
|
||||
{
|
||||
heap_delete(catalogRelation, &tuple->t_ctid);
|
||||
}
|
||||
heap_endscan(scan);
|
||||
heap_close(catalogRelation);
|
||||
|
||||
@@ -1410,9 +1398,7 @@ UpdateStats(Oid relid, long reltuples, bool hasindex)
|
||||
*/
|
||||
pg_class = heap_openr(RelationRelationName);
|
||||
if (!RelationIsValid(pg_class))
|
||||
{
|
||||
elog(ERROR, "UpdateStats: could not open RELATION relation");
|
||||
}
|
||||
key[0].sk_argument = ObjectIdGetDatum(relid);
|
||||
|
||||
pg_class_scan =
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.17 1998/04/27 04:04:58 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/indexing.c,v 1.18 1998/06/15 19:28:09 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -80,9 +80,7 @@ CatalogOpenIndices(int nIndices, char *names[], Relation idescs[])
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nIndices; i++)
|
||||
{
|
||||
idescs[i] = index_openr(names[i]);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.17 1998/04/27 04:05:03 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.18 1998/06/15 19:28:10 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -94,9 +94,7 @@ ProcedureCreate(char *procedureName,
|
||||
if (strcmp(strVal(t), "opaque") == 0)
|
||||
{
|
||||
if (strcmp(languageName, "sql") == 0)
|
||||
{
|
||||
elog(ERROR, "ProcedureDefine: sql functions cannot take type \"opaque\"");
|
||||
}
|
||||
toid = 0;
|
||||
}
|
||||
else
|
||||
@@ -162,9 +160,7 @@ ProcedureCreate(char *procedureName,
|
||||
if (strcmp(returnTypeName, "opaque") == 0)
|
||||
{
|
||||
if (strcmp(languageName, "sql") == 0)
|
||||
{
|
||||
elog(ERROR, "ProcedureCreate: sql functions cannot return type \"opaque\"");
|
||||
}
|
||||
typeObjectId = 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.24 1998/05/09 23:43:00 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/catalog/pg_type.c,v 1.25 1998/06/15 19:28:10 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -334,9 +334,7 @@ TypeCreate(char *typeName,
|
||||
*/
|
||||
typeObjectId = TypeGet(typeName, &defined);
|
||||
if (OidIsValid(typeObjectId) && defined)
|
||||
{
|
||||
elog(ERROR, "TypeCreate: type %s already defined", typeName);
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* if this type has an associated elementType, then we check that
|
||||
@@ -347,9 +345,7 @@ TypeCreate(char *typeName,
|
||||
{
|
||||
elementObjectId = TypeGet(elementTypeName, &defined);
|
||||
if (!defined)
|
||||
{
|
||||
elog(ERROR, "TypeCreate: type %s is not defined", elementTypeName);
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
@@ -437,9 +433,7 @@ TypeCreate(char *typeName,
|
||||
0);
|
||||
}
|
||||
if (!HeapTupleIsValid(tup))
|
||||
{
|
||||
func_error("TypeCreate", procname, 1, argList, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
values[i++] = (Datum) tup->t_oid; /* 11 - 14 */
|
||||
@@ -559,9 +553,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
|
||||
/* check that that the new type is not already defined */
|
||||
type_oid = TypeGet(newTypeName, &defined);
|
||||
if (OidIsValid(type_oid) && defined)
|
||||
{
|
||||
elog(ERROR, "TypeRename: type %s already defined", newTypeName);
|
||||
}
|
||||
|
||||
/* get the type tuple from the catalog index scan manager */
|
||||
pg_type_desc = heap_openr(TypeRelationName);
|
||||
@@ -592,9 +584,7 @@ TypeRename(char *oldTypeName, char *newTypeName)
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "TypeRename: type %s not defined", oldTypeName);
|
||||
}
|
||||
|
||||
/* finish up */
|
||||
heap_close(pg_type_desc);
|
||||
|
||||
Reference in New Issue
Block a user