77 *
88 *
99 * IDENTIFICATION
10- * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.38 2000/01/1102:30:05 momjian Exp $
10+ * $Header: /cvsroot/pgsql/src/backend/catalog/pg_proc.c,v 1.39 2000/01/1105:22:25 tgl Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -80,8 +80,9 @@ ProcedureCreate(char *procedureName,
8080{
8181Value * t = lfirst (x );
8282
83- if (parameterCount > FUNC_MAX_ARGS )
84- elog (ERROR ,"Procedures cannot take more than %d arguments" ,FUNC_MAX_ARGS );
83+ if (parameterCount >=FUNC_MAX_ARGS )
84+ elog (ERROR ,"Procedures cannot take more than %d arguments" ,
85+ FUNC_MAX_ARGS );
8586
8687if (strcmp (strVal (t ),"opaque" )== 0 )
8788{
@@ -172,7 +173,6 @@ ProcedureCreate(char *procedureName,
172173elog (ERROR ,"ProcedureCreate: sql functions cannot return type \"opaque\"" );
173174typeObjectId = 0 ;
174175}
175-
176176else
177177{
178178typeObjectId = TypeGet (returnTypeName ,& defined );
@@ -192,7 +192,6 @@ ProcedureCreate(char *procedureName,
192192returnTypeName );
193193}
194194}
195-
196195else if (!defined )
197196{
198197elog (NOTICE ,"ProcedureCreate: return type '%s' is only a shell" ,
@@ -247,7 +246,7 @@ ProcedureCreate(char *procedureName,
247246prosrc = procedureName ;
248247if (fmgr_lookupByName (prosrc )== (func_ptr )NULL )
249248elog (ERROR ,
250- "ProcedureCreate: there is no builtin function named \"%s\"" ,
249+ "ProcedureCreate: there is no builtin function named \"%s\"" ,
251250prosrc );
252251}
253252
@@ -266,30 +265,18 @@ ProcedureCreate(char *procedureName,
266265values [i ++ ]= NameGetDatum (& procname );
267266values [i ++ ]= Int32GetDatum (GetUserId ());
268267values [i ++ ]= ObjectIdGetDatum (languageObjectId );
269-
270268/* XXX isinherited is always false for now */
271-
272269values [i ++ ]= Int8GetDatum ((bool )0 );
273-
274- /* XXX istrusted is always false for now */
275-
276270values [i ++ ]= Int8GetDatum (trusted );
277271values [i ++ ]= Int8GetDatum (canCache );
278272values [i ++ ]= UInt16GetDatum (parameterCount );
279273values [i ++ ]= Int8GetDatum (returnsSet );
280274values [i ++ ]= ObjectIdGetDatum (typeObjectId );
281-
282275values [i ++ ]= (Datum )typev ;
283-
284- /*
285- * The following assignments of constants are made. The real values
286- * will have to be extracted from the arglist someday soon.
287- */
288276values [i ++ ]= Int32GetDatum (byte_pct );/* probyte_pct */
289277values [i ++ ]= Int32GetDatum (perbyte_cpu );/* properbyte_cpu */
290278values [i ++ ]= Int32GetDatum (percall_cpu );/* propercall_cpu */
291279values [i ++ ]= Int32GetDatum (outin_ratio );/* prooutin_ratio */
292-
293280values [i ++ ]= (Datum )fmgr (F_TEXTIN ,prosrc );/* prosrc */
294281values [i ++ ]= (Datum )fmgr (F_TEXTIN ,probin );/* probin */
295282