func_error() changed so that if caller is passed with NULL value, its
authorMarc G. Fournier <scrappy@hub.org>
Thu, 5 Feb 1998 04:08:44 +0000 (04:08 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Thu, 5 Feb 1998 04:08:44 +0000 (04:08 +0000)
output at least doesn't appear that its missing something.

wasn't particularly confident with removing 'caller' altogether :(

src/backend/parser/parse_func.c
src/include/parser/parse_func.h

index f1ce43f8b82eff0eac933240646c48a2d4677854..2325251ade3ef83c3f19a24d34d6e6cfa27ef173 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.11 1998/02/05 03:35:48 scrappy Exp $
+ *       $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.12 1998/02/05 04:08:42 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -728,7 +728,7 @@ func_get_detail(char *funcname,
                                                         funcname);
                                                elog(NOTICE, "that satisfies the given argument types. you will have to");
                                                elog(NOTICE, "retype your query using explicit typecasts.");
-                                               func_error(funcname, nargs, oid_array);
+                                               func_error(NULL, funcname, nargs, oid_array);
                                        }
                                        else
                                        {
@@ -758,7 +758,7 @@ func_get_detail(char *funcname,
                                elog(ERROR, "no such attribute or function \"%s\"",
                                         funcname);
                }
-               func_error(funcname, nargs, oid_array);
+               func_error(NULL, funcname, nargs, oid_array);
        }
        else
        {
@@ -1276,7 +1276,7 @@ ParseComplexProjection(ParseState *pstate,
  * argument types
  */
 void
-func_error(char *funcname, int nargs, Oid *argtypes)
+func_error(char *caller, char *funcname, int nargs, Oid *argtypes)
 {
        char            p[(NAMEDATALEN + 2) * MAXFMGRARGS],
                           *ptr;
@@ -1301,5 +1301,9 @@ func_error(char *funcname, int nargs, Oid *argtypes)
                ptr += strlen(ptr);
        }
 
-       elog(ERROR, "function %s(%s) does not exist", funcname, p);
+  if(caller == NULL) {
+         elog(ERROR, "function %s(%s) does not exist", funcname, p);
+  } else {
+         elog(ERROR, "%s: function %s(%s) does not exist", caller, funcname, p);
+  }
 }
index 119d242f407193025fdce14b06472d26a71d93ac..4b03e0ced5893889b0c461a810e7dcdb91c6605a 100644 (file)
@@ -6,7 +6,7 @@
  *
  * Copyright (c) 1994, Regents of the University of California
  *
- * $Id: parse_func.h,v 1.6 1998/02/05 03:40:10 scrappy Exp $
+ * $Id: parse_func.h,v 1.7 1998/02/05 04:08:44 scrappy Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -47,7 +47,7 @@ extern Node *ParseNestedFuncOrColumn(ParseState *pstate, Attr *attr,
 extern Node *ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
        int *curr_resno, int precedence);
 
-extern void func_error(char *funcname, int nargs, Oid *argtypes);
+extern void func_error(char *caller, char *funcname, int nargs, Oid *argtypes);
 
 #endif                                                 /* PARSE_FUNC_H */