mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Remove un-needed braces around single statements.
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.12 1998/06/04 17:26:38 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/_deadcode/Attic/version.c,v 1.13 1998/06/15 19:28:17 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* At the point the version is defined, 2 physical relations are created
|
||||
@@ -207,9 +207,7 @@ setAttrList(char *bname)
|
||||
attrname = (rdesc->rd_att->attrs[i]->attname).data;
|
||||
|
||||
if (notfirst == 1)
|
||||
{
|
||||
sprintf(temp_buf, ", %s = new.%s", attrname, attrname);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(temp_buf, "%s = new.%s", attrname, attrname);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.32 1998/05/06 23:49:52 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.33 1998/06/15 19:28:11 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -312,9 +312,7 @@ Async_NotifyAtCommit()
|
||||
if (kill(DatumGetInt32(d), SIGUSR2) < 0)
|
||||
{
|
||||
if (errno == ESRCH)
|
||||
{
|
||||
heap_delete(lRel, &lTuple->t_ctid);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -360,9 +358,7 @@ Async_NotifyAtAbort()
|
||||
extern TransactionState CurrentTransactionState;
|
||||
|
||||
if (notifyIssued)
|
||||
{
|
||||
ClearPendingNotify();
|
||||
}
|
||||
notifyIssued = 0;
|
||||
if (pendingNotifies)
|
||||
DLFreeList(pendingNotifies);
|
||||
@@ -446,9 +442,7 @@ Async_Listen(char *relname, int pid)
|
||||
d = heap_getattr(htup, Anum_pg_listener_pid, tdesc, &isnull);
|
||||
pid = DatumGetInt32(d);
|
||||
if (pid == MyProcPid)
|
||||
{
|
||||
alreadyListener = 1;
|
||||
}
|
||||
}
|
||||
ReleaseBuffer(b);
|
||||
}
|
||||
@@ -517,9 +511,7 @@ Async_Unlisten(char *relname, int pid)
|
||||
RelationSetLockForWrite(lDesc);
|
||||
|
||||
if (lTuple != NULL)
|
||||
{
|
||||
heap_delete(lDesc, &lTuple->t_ctid);
|
||||
}
|
||||
|
||||
RelationUnsetLockForWrite(lDesc);
|
||||
heap_close(lDesc);
|
||||
@@ -610,9 +602,7 @@ Async_NotifyFrontEnd()
|
||||
pq_flush();
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(NOTICE, "Async_NotifyFrontEnd: no asynchronous notification to frontend on interactive sessions");
|
||||
}
|
||||
ReleaseBuffer(b);
|
||||
}
|
||||
CommitTransactionCommand();
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.27 1998/04/27 04:05:10 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/command.c,v 1.28 1998/06/15 19:28:12 momjian Exp $
|
||||
*
|
||||
* NOTES
|
||||
* The PortalExecutorHeapMemory crap needs to be eliminated
|
||||
@@ -475,9 +475,7 @@ PerformAddAttribute(char *relationName,
|
||||
form = (TypeTupleForm) GETSTRUCT(typeTuple);
|
||||
|
||||
if (!HeapTupleIsValid(typeTuple))
|
||||
{
|
||||
elog(ERROR, "Add: type \"%s\" nonexistent", p);
|
||||
}
|
||||
namestrcpy(&(attribute->attname), (char *) key[1].sk_argument);
|
||||
|
||||
attribute->atttypid = typeTuple->t_oid;
|
||||
|
@@ -6,7 +6,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.45 1998/03/30 16:45:55 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.46 1998/06/15 19:28:13 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -284,9 +284,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
fputs("\\N", fp); /* null indicator */
|
||||
|
||||
if (i == attr_count - 1)
|
||||
{
|
||||
fputc('\n', fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -343,9 +341,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
|
||||
heap_endscan(scandesc);
|
||||
if (binary)
|
||||
{
|
||||
pfree(nulls);
|
||||
}
|
||||
else
|
||||
{
|
||||
pfree(out_functions);
|
||||
@@ -494,9 +490,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
indexPred[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -576,9 +570,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
nulls[i] = 'n';
|
||||
}
|
||||
else if (string == NULL)
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
values[i] =
|
||||
@@ -592,25 +584,19 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
*/
|
||||
if (!PointerIsValid(values[i]) &&
|
||||
!(rel->rd_att->attrs[i]->attbyval))
|
||||
{
|
||||
elog(ERROR, "copy from line %d: Bad file format", lineno);
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef COPY_PATCH
|
||||
if (!done)
|
||||
{
|
||||
CopyReadNewline(fp, &newline);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{ /* binary */
|
||||
fread(&len, sizeof(int32), 1, fp);
|
||||
if (feof(fp))
|
||||
{
|
||||
done = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (oids)
|
||||
@@ -799,9 +785,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
|
||||
pfree((void *) values[i]);
|
||||
}
|
||||
else if (nulls[i] == 'n')
|
||||
{
|
||||
nulls[i] = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
pfree(tuple);
|
||||
@@ -959,9 +943,7 @@ GetIndexRelations(Oid main_relation_oid,
|
||||
*index_rels = (Relation *) palloc(*n_indices * sizeof(Relation));
|
||||
|
||||
for (i = 0, scan = head; i < *n_indices; i++, scan = scan->next)
|
||||
{
|
||||
(*index_rels)[i] = index_open(scan->index_rel_oid);
|
||||
}
|
||||
|
||||
for (i = 0, scan = head; i < *n_indices + 1; i++)
|
||||
{
|
||||
@@ -1075,9 +1057,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
|
||||
val = (val << 3) + VALUE(c);
|
||||
c = getc(fp);
|
||||
if (ISOCTAL(c))
|
||||
{
|
||||
val = (val << 3) + VALUE(c);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (feof(fp))
|
||||
@@ -1128,9 +1108,7 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim)
|
||||
{
|
||||
#ifdef COPY_PATCH
|
||||
if (c == '\n')
|
||||
{
|
||||
*newline = 1;
|
||||
}
|
||||
#endif
|
||||
done = 1;
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.29 1998/04/26 04:06:20 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/creatinh.c,v 1.30 1998/06/15 19:28:14 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -256,9 +256,7 @@ MergeAttributes(List *schema, List *supers, List **supconstr)
|
||||
"MergeAttr: Can't inherit from non-existent superclass '%s'", name);
|
||||
}
|
||||
if (relation->rd_rel->relkind == 'S')
|
||||
{
|
||||
elog(ERROR, "MergeAttr: Can't inherit from sequence superclass '%s'", name);
|
||||
}
|
||||
tupleDesc = RelationGetTupleDescriptor(relation);
|
||||
constr = tupleDesc->constr;
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.14 1998/06/04 17:26:38 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.15 1998/06/15 19:28:14 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -68,9 +68,7 @@ createdb(char *dbname, char *dbpath)
|
||||
sprintf(loc, "%s%c%s", dbpath, SEP_CHAR, dbname);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy(loc, dbname);
|
||||
}
|
||||
|
||||
lp = ExpandDatabasePath(loc);
|
||||
|
||||
@@ -114,9 +112,7 @@ destroydb(char *dbname)
|
||||
check_permissions("destroydb", dbpath, dbname, &db_id, &user_id);
|
||||
|
||||
if (!OidIsValid(db_id))
|
||||
{
|
||||
elog(FATAL, "impossible: pg_database instance with invalid OID.");
|
||||
}
|
||||
|
||||
/* stop the vacuum daemon */
|
||||
stop_vacuum(dbpath, dbname);
|
||||
@@ -224,15 +220,11 @@ check_permissions(char *command,
|
||||
|
||||
/* Make sure we are not mucking with the template database */
|
||||
if (!strcmp(dbname, "template1"))
|
||||
{
|
||||
elog(ERROR, "%s cannot be executed on the template database.", command);
|
||||
}
|
||||
|
||||
/* Check to make sure database is not the currently open database */
|
||||
if (!strcmp(dbname, DatabaseName))
|
||||
{
|
||||
elog(ERROR, "%s cannot be executed on an open database", command);
|
||||
}
|
||||
|
||||
/* Check to make sure database is owned by this user */
|
||||
|
||||
@@ -272,9 +264,7 @@ check_permissions(char *command,
|
||||
*(path + VARSIZE(dbtext) - VARHDRSZ) = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
*dbIdP = InvalidOid;
|
||||
}
|
||||
|
||||
heap_close(dbrel);
|
||||
|
||||
@@ -322,9 +312,7 @@ stop_vacuum(char *dbpath, char *dbname)
|
||||
dbname, SEP_CHAR, dbname);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(filename, "%s%c%s.vacuum", dbpath, SEP_CHAR, dbname);
|
||||
}
|
||||
|
||||
if ((fp = AllocateFile(filename, "r")) != NULL)
|
||||
{
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.20 1998/01/05 16:38:52 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/defind.c,v 1.21 1998/06/15 19:28:15 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -94,9 +94,7 @@ DefineIndex(char *heapRelationName,
|
||||
*/
|
||||
numberOfAttributes = length(attributeList);
|
||||
if (numberOfAttributes <= 0)
|
||||
{
|
||||
elog(ERROR, "DefineIndex: must specify at least one attribute");
|
||||
}
|
||||
|
||||
/*
|
||||
* compute heap relation id
|
||||
@@ -369,9 +367,7 @@ CheckPredicate(List *predList, List *rangeTable, Oid baseRelOid)
|
||||
List *item;
|
||||
|
||||
foreach(item, predList)
|
||||
{
|
||||
CheckPredExpr(lfirst(item), rangeTable, baseRelOid);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -391,9 +387,7 @@ CheckPredExpr(Node *predicate, List *rangeTable, Oid baseRelOid)
|
||||
elog(ERROR, "Unsupported partial-index predicate expression type");
|
||||
|
||||
foreach(clause, clauses)
|
||||
{
|
||||
CheckPredExpr(lfirst(clause), rangeTable, baseRelOid);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -408,9 +402,7 @@ CheckPredClause(Expr *predicate, List *rangeTable, Oid baseRelOid)
|
||||
if (!IsA(predicate->oper, Oper) ||
|
||||
!IsA(pred_var, Var) ||
|
||||
!IsA(pred_const, Const))
|
||||
{
|
||||
elog(ERROR, "Unsupported partial-index predicate clause type");
|
||||
}
|
||||
|
||||
if (getrelid(pred_var->varno, rangeTable) != baseRelOid)
|
||||
elog(ERROR,
|
||||
@@ -538,9 +530,7 @@ GetDefaultOpClass(Oid atttypid)
|
||||
ObjectIdGetDatum(atttypid),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return nameout(&(((Form_pg_opclass) GETSTRUCT(tuple))->opcname));
|
||||
}
|
||||
@@ -564,9 +554,7 @@ RemoveIndex(char *name)
|
||||
0, 0, 0);
|
||||
|
||||
if (!HeapTupleIsValid(tuple))
|
||||
{
|
||||
elog(ERROR, "index \"%s\" nonexistent", name);
|
||||
}
|
||||
|
||||
if (((Form_pg_class) GETSTRUCT(tuple))->relkind != RELKIND_INDEX)
|
||||
{
|
||||
|
@@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.24 1998/02/26 04:30:57 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/define.c,v 1.25 1998/06/15 19:28:15 momjian Exp $
|
||||
*
|
||||
* DESCRIPTION
|
||||
* The "DefineFoo" routines take the parse tree and pick out the
|
||||
@@ -130,9 +130,7 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p,
|
||||
ParamString *param = (ParamString *) lfirst(pl);
|
||||
|
||||
if (strcasecmp(param->name, "iscachable") == 0)
|
||||
{
|
||||
*canCache_p = true;
|
||||
}
|
||||
else if (strcasecmp(param->name, "trusted") == 0)
|
||||
{
|
||||
|
||||
@@ -177,9 +175,7 @@ compute_full_attributes(const List *parameters, int32 *byte_pct_p,
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(param->name, "outin_ratio") == 0)
|
||||
{
|
||||
*outin_ratio_p = atoi(param->val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,13 +390,9 @@ DefineOperator(char *oprName,
|
||||
elog(ERROR, "setof type not implemented for leftarg");
|
||||
|
||||
if (nodeTag(defel->arg) == T_String)
|
||||
{
|
||||
typeName1 = defGetString(defel);
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "type for leftarg is malformed.");
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "rightarg"))
|
||||
{
|
||||
@@ -409,18 +401,12 @@ DefineOperator(char *oprName,
|
||||
elog(ERROR, "setof type not implemented for rightarg");
|
||||
|
||||
if (nodeTag(defel->arg) == T_String)
|
||||
{
|
||||
typeName2 = defGetString(defel);
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "type for rightarg is malformed.");
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "procedure"))
|
||||
{
|
||||
functionName = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "precedence"))
|
||||
{
|
||||
/* NOT IMPLEMENTED (never worked in v4.2) */
|
||||
@@ -432,25 +418,15 @@ DefineOperator(char *oprName,
|
||||
elog(NOTICE, "CREATE OPERATOR: associativity not implemented");
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "commutator"))
|
||||
{
|
||||
commutatorName = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "negator"))
|
||||
{
|
||||
negatorName = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "restrict"))
|
||||
{
|
||||
restrictionName = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "join"))
|
||||
{
|
||||
joinName = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "hashes"))
|
||||
{
|
||||
canHash = TRUE;
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "sort1"))
|
||||
{
|
||||
/* ----------------
|
||||
@@ -462,9 +438,7 @@ DefineOperator(char *oprName,
|
||||
sortName1 = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "sort2"))
|
||||
{
|
||||
sortName2 = defGetString(defel);
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(NOTICE, "DefineOperator: attribute \"%s\" not recognized",
|
||||
@@ -476,9 +450,7 @@ DefineOperator(char *oprName,
|
||||
* make sure we have our required definitions
|
||||
*/
|
||||
if (functionName == NULL)
|
||||
{
|
||||
elog(ERROR, "Define: \"procedure\" unspecified");
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* now have OperatorCreate do all the work..
|
||||
@@ -528,13 +500,9 @@ DefineAggregate(char *aggName, List *parameters)
|
||||
* sfunc1
|
||||
*/
|
||||
if (!strcasecmp(defel->defname, "sfunc1"))
|
||||
{
|
||||
stepfunc1Name = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "basetype"))
|
||||
{
|
||||
baseType = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "stype1"))
|
||||
{
|
||||
stepfunc1Type = defGetString(defel);
|
||||
@@ -544,9 +512,7 @@ DefineAggregate(char *aggName, List *parameters)
|
||||
*/
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "sfunc2"))
|
||||
{
|
||||
stepfunc2Name = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "stype2"))
|
||||
{
|
||||
stepfunc2Type = defGetString(defel);
|
||||
@@ -564,13 +530,9 @@ DefineAggregate(char *aggName, List *parameters)
|
||||
*/
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "initcond1"))
|
||||
{
|
||||
init1 = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "initcond2"))
|
||||
{
|
||||
init2 = defGetString(defel);
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(NOTICE, "DefineAggregate: attribute \"%s\" not recognized",
|
||||
@@ -647,25 +609,15 @@ DefineType(char *typeName, List *parameters)
|
||||
DefElem *defel = (DefElem *) lfirst(pl);
|
||||
|
||||
if (!strcasecmp(defel->defname, "internallength"))
|
||||
{
|
||||
internalLength = defGetTypeLength(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "externallength"))
|
||||
{
|
||||
externalLength = defGetTypeLength(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "input"))
|
||||
{
|
||||
inputName = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "output"))
|
||||
{
|
||||
outputName = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "send"))
|
||||
{
|
||||
sendName = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "delimiter"))
|
||||
{
|
||||
char *p = defGetString(defel);
|
||||
@@ -673,33 +625,21 @@ DefineType(char *typeName, List *parameters)
|
||||
delimiter = p[0];
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "receive"))
|
||||
{
|
||||
receiveName = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "element"))
|
||||
{
|
||||
elemName = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "default"))
|
||||
{
|
||||
defaultValue = defGetString(defel);
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "passedbyvalue"))
|
||||
{
|
||||
byValue = true;
|
||||
}
|
||||
else if (!strcasecmp(defel->defname, "alignment"))
|
||||
{
|
||||
char *a = defGetString(defel);
|
||||
|
||||
if (!strcasecmp(a, "double"))
|
||||
{
|
||||
alignment = 'd';
|
||||
}
|
||||
else if (!strcasecmp(a, "int"))
|
||||
{
|
||||
alignment = 'i';
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "DefineType: \"%s\" alignment not recognized",
|
||||
|
@@ -80,9 +80,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
|
||||
PointerGetDatum(languageName),
|
||||
0, 0, 0);
|
||||
if (HeapTupleIsValid(langTup))
|
||||
{
|
||||
elog(ERROR, "Language %s already exists", languageName);
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* Lookup the PL handler function and check that it is
|
||||
@@ -171,9 +169,7 @@ DropProceduralLanguage(DropPLangStmt *stmt)
|
||||
PointerGetDatum(languageName),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(langTup))
|
||||
{
|
||||
elog(ERROR, "Language %s doesn't exist", languageName);
|
||||
}
|
||||
|
||||
if (!((Form_pg_language) GETSTRUCT(langTup))->lanispl)
|
||||
{
|
||||
@@ -195,9 +191,7 @@ DropProceduralLanguage(DropPLangStmt *stmt)
|
||||
tup = heap_getnext(scanDesc, 0, (Buffer *) NULL);
|
||||
|
||||
if (!HeapTupleIsValid(tup))
|
||||
{
|
||||
elog(ERROR, "Language with name '%s' not found", languageName);
|
||||
}
|
||||
|
||||
heap_delete(rdesc, &(tup->t_ctid));
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.20 1998/02/26 04:30:59 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/recipe.c,v 1.21 1998/06/15 19:28:15 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -387,9 +387,7 @@ tg_rewriteQuery(TgRecipe * r,
|
||||
{
|
||||
tle = lfirst(tl);
|
||||
if (tle->resdom != NULL)
|
||||
{
|
||||
tle->expr = tg_rewriteParamsInExpr(tle->expr, inputQlist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,9 +399,7 @@ tg_rewriteQuery(TgRecipe * r,
|
||||
if (orig->qual)
|
||||
{
|
||||
if (nodeTag(orig->qual) == T_List)
|
||||
{
|
||||
elog(ERROR, "tg_rewriteQuery: Whoa! why is my qual a List???");
|
||||
}
|
||||
orig->qual = tg_rewriteParamsInExpr(orig->qual, inputQlist);
|
||||
}
|
||||
|
||||
@@ -514,9 +510,7 @@ tg_replaceNumberedParam(Node *expression,
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(NOTICE, "tg_replaceNumberedParam: unexpected paramkind value of %d", p->paramkind);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case T_Expr:
|
||||
@@ -626,15 +620,11 @@ tg_rewriteParamsInExpr(Node *expression, QueryTreeList *inputQlist)
|
||||
{
|
||||
tle = lfirst(tl);
|
||||
if (strcmp(resname, tle->resdom->resname) == 0)
|
||||
{
|
||||
return tle->expr;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "tg_rewriteParamsInExpr:can't substitute for parameter %d when that input is unconnected", p->paramid);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
@@ -648,9 +638,7 @@ tg_rewriteParamsInExpr(Node *expression, QueryTreeList *inputQlist)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(NOTICE, "tg_rewriteParamsInExpr: unexpected paramkind value of %d", p->paramkind);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case T_Expr:
|
||||
@@ -716,9 +704,7 @@ getParamTypes(TgElement * elem, Oid typev[])
|
||||
|
||||
parameterCount = 0;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
typev[i] = 0;
|
||||
}
|
||||
for (j = 0; j < elem->inTypes->num; j++)
|
||||
{
|
||||
if (parameterCount == 8)
|
||||
@@ -736,13 +722,9 @@ getParamTypes(TgElement * elem, Oid typev[])
|
||||
{
|
||||
toid = TypeGet(elem->inTypes->val[j], &defined);
|
||||
if (!OidIsValid(toid))
|
||||
{
|
||||
elog(ERROR, "getParamTypes: arg type '%s' is not defined", t);
|
||||
}
|
||||
if (!defined)
|
||||
{
|
||||
elog(NOTICE, "getParamTypes: arg type '%s' is only a shell", t);
|
||||
}
|
||||
}
|
||||
typev[parameterCount++] = toid;
|
||||
}
|
||||
@@ -904,9 +886,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
|
||||
|
||||
sprintf(newquery, "select %s($1", funcName);
|
||||
for (i = 1; i < parameterCount; i++)
|
||||
{
|
||||
sprintf(newquery, "%s,$%d", newquery, i);
|
||||
}
|
||||
sprintf(newquery, "%s)", newquery);
|
||||
}
|
||||
else
|
||||
@@ -1071,9 +1051,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
|
||||
"result",
|
||||
InvalidOid,
|
||||
-1, 0, false))
|
||||
{
|
||||
elog(NOTICE, "tg_parseSubQuery: unexpected result from TupleDescInitEntry");
|
||||
}
|
||||
else
|
||||
{
|
||||
relid = heap_create_with_catalog(
|
||||
@@ -1083,9 +1061,7 @@ tg_parseSubQuery(TgRecipe * r, TgNode * n, TeeInfo * teeInfo)
|
||||
}
|
||||
}
|
||||
else if (n->nodeType == TG_RECIPE_NODE)
|
||||
{
|
||||
elog(NOTICE, "tg_parseSubQuery: can't handle embedded recipes yet!");
|
||||
}
|
||||
else
|
||||
elog(NOTICE, "unknown nodeType: %d", n->nodeType);
|
||||
|
||||
@@ -1134,9 +1110,7 @@ OffsetVarAttno(Node *node, int varno, int offset)
|
||||
List *l;
|
||||
|
||||
foreach(l, (List *) node)
|
||||
{
|
||||
OffsetVarAttno(lfirst(l), varno, offset);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@@ -1174,9 +1148,7 @@ appendQlist(QueryTreeList *q1, QueryTreeList *q2)
|
||||
for (i = 0; i < q1->len; i++)
|
||||
newq->qtrees[i] = q1->qtrees[i];
|
||||
for (j = 0; j < q2->len; j++)
|
||||
{
|
||||
newq->qtrees[i + j] = q2->qtrees[j];
|
||||
}
|
||||
return newq;
|
||||
}
|
||||
|
||||
@@ -1225,9 +1197,7 @@ replaceSeqScan(Plan *plan, Plan *parent,
|
||||
Result *newPlan;
|
||||
|
||||
if (plan == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (plan->type == T_SeqScan)
|
||||
{
|
||||
@@ -1288,13 +1258,9 @@ replaceSeqScan(Plan *plan, Plan *parent,
|
||||
else
|
||||
{
|
||||
if (plan->lefttree)
|
||||
{
|
||||
replaceSeqScan(plan->lefttree, plan, rt_ind, tplan);
|
||||
}
|
||||
if (plan->righttree)
|
||||
{
|
||||
replaceSeqScan(plan->righttree, plan, rt_ind, tplan);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1352,14 +1318,10 @@ replaceTeeScans(Plan *plan, Query *parsetree, TeeInfo * teeInfo)
|
||||
{
|
||||
if (strcmp(teeInfo->val[i].tpi_relName,
|
||||
rte->refname) == 0)
|
||||
{
|
||||
tplan = teeInfo->val[i].tpi_plan;
|
||||
}
|
||||
}
|
||||
if (tplan == NULL)
|
||||
{
|
||||
elog(NOTICE, "replaceTeeScans didn't find the corresponding tee plan");
|
||||
}
|
||||
|
||||
/*
|
||||
* replace the sequential scan node with that var number with
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.24 1998/05/09 23:43:45 thomas Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/Attic/remove.c,v 1.25 1998/06/15 19:28:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -364,9 +364,7 @@ RemoveFunction(char *functionName, /* function name to be removed */
|
||||
0, 0, 0);
|
||||
|
||||
if (!HeapTupleIsValid(tup))
|
||||
{
|
||||
elog(ERROR, "RemoveFunction: type '%s' not found", typename);
|
||||
}
|
||||
argList[i] = tup->t_oid;
|
||||
}
|
||||
}
|
||||
@@ -458,14 +456,10 @@ RemoveAggregate(char *aggName, char *aggType)
|
||||
{
|
||||
basetypeID = TypeGet(aggType, &defined);
|
||||
if (!OidIsValid(basetypeID))
|
||||
{
|
||||
elog(ERROR, "RemoveAggregate: type '%s' does not exist", aggType);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
basetypeID = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
#ifndef NO_SECURITY
|
||||
|
@@ -313,9 +313,7 @@ currval(struct varlena * seqin)
|
||||
pfree(seqname);
|
||||
|
||||
if (elm->increment == 0) /* nextval/read_info were not called */
|
||||
{
|
||||
elog(ERROR, "%s.currval is not yet defined in this session", elm->name);
|
||||
}
|
||||
|
||||
result = elm->last;
|
||||
|
||||
|
@@ -149,14 +149,10 @@ CreateTrigger(CreateTrigStmt *stmt)
|
||||
ObjectIdGetDatum(((Form_pg_proc) GETSTRUCT(tuple))->prolang),
|
||||
0, 0, 0);
|
||||
if (!HeapTupleIsValid(langTup))
|
||||
{
|
||||
elog(ERROR, "CreateTrigger: cache lookup for PL failed");
|
||||
}
|
||||
|
||||
if (((Form_pg_language) GETSTRUCT(langTup))->lanispl == false)
|
||||
{
|
||||
elog(ERROR, "CreateTrigger: only C and PL functions are supported");
|
||||
}
|
||||
}
|
||||
|
||||
MemSet(nulls, ' ', Natts_pg_trigger * sizeof(char));
|
||||
@@ -598,9 +594,7 @@ ExecCallTriggerFunc(Trigger *trigger)
|
||||
{
|
||||
|
||||
if (trigger->tgfunc.fn_addr == NULL)
|
||||
{
|
||||
fmgr_info(trigger->tgfoid, &trigger->tgfunc);
|
||||
}
|
||||
|
||||
if (trigger->tgfunc.fn_plhandler != NULL)
|
||||
{
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.64 1998/04/27 04:05:31 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/vacuum.c,v 1.65 1998/06/15 19:28:16 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -333,9 +333,7 @@ vc_getrels(NameData *VacRelP)
|
||||
/* get a relation list entry for this guy */
|
||||
old = MemoryContextSwitchTo((MemoryContext) portalmem);
|
||||
if (vrl == (VRelList) NULL)
|
||||
{
|
||||
vrl = cur = (VRelList) palloc(sizeof(VRelListData));
|
||||
}
|
||||
else
|
||||
{
|
||||
cur->vrl_next = (VRelList) palloc(sizeof(VRelListData));
|
||||
@@ -1029,9 +1027,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
|
||||
dowrite = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert(isempty);
|
||||
}
|
||||
--Vnpages;
|
||||
Assert(Vnpages > 0);
|
||||
/* get prev reapped page from Vvpl */
|
||||
@@ -1054,9 +1050,7 @@ vc_rpfheap(VRelStats *vacrelstats, Relation onerel,
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert(!isempty);
|
||||
}
|
||||
|
||||
vpc->vpd_blkno = blkno;
|
||||
maxoff = PageGetMaxOffsetNumber(page);
|
||||
@@ -1529,9 +1523,7 @@ vc_vaconeind(VPageList vpl, Relation indrel, int nhtups)
|
||||
index_delete(indrel, &res->index_iptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
nitups++;
|
||||
}
|
||||
|
||||
/* be tidy */
|
||||
pfree(res);
|
||||
@@ -2219,9 +2211,7 @@ vc_clsindices(int nindices, Relation *Irel)
|
||||
return;
|
||||
|
||||
while (nindices--)
|
||||
{
|
||||
index_close(Irel[nindices]);
|
||||
}
|
||||
pfree(Irel);
|
||||
|
||||
} /* vc_clsindices */
|
||||
|
@@ -2,7 +2,7 @@
|
||||
* Routines for handling of 'SET var TO',
|
||||
* 'SHOW var' and 'RESET var' statements.
|
||||
*
|
||||
* $Id: variable.c,v 1.5 1998/03/30 16:45:59 momjian Exp $
|
||||
* $Id: variable.c,v 1.6 1998/06/15 19:28:17 momjian Exp $
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -365,9 +365,7 @@ parse_date(const char *value)
|
||||
ecnt++;
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "Bad value for date style (%s)", tok);
|
||||
}
|
||||
pfree(tok);
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.21 1998/02/26 04:31:06 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/view.c,v 1.22 1998/06/15 19:28:17 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -90,9 +90,7 @@ DefineVirtualRelation(char *relname, List *tlist)
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
elog(ERROR, "attempted to define virtual relation with no attrs");
|
||||
}
|
||||
|
||||
/*
|
||||
* now create the parametesr for keys/inheritance etc. All of them are
|
||||
|
Reference in New Issue
Block a user