OSDN Git Service

Operators live in namespaces. CREATE/DROP/COMMENT ON OPERATOR take
[pg-rex/syncrep.git] / src / include / parser / parse_func.h
index e5cf03d..17c618f 100644 (file)
@@ -1,24 +1,20 @@
 /*-------------------------------------------------------------------------
  *
- * parse_func.h--
+ * parse_func.h
  *
  *
  *
- * Copyright (c) 1994, Regents of the University of California
+ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $Id: parse_func.h,v 1.13 1998/12/08 06:18:27 thomas Exp $
+ * $Id: parse_func.h,v 1.40 2002/04/16 23:08:12 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
 #ifndef PARSER_FUNC_H
 #define PARSER_FUNC_H
 
-#include <nodes/nodes.h>
-#include <nodes/pg_list.h>
-#include <nodes/parsenodes.h>
-#include <nodes/primnodes.h>
-#include <parser/parse_func.h>
-#include <parser/parse_node.h>
+#include "parser/parse_node.h"
 
 /*
  *     This structure is used to explore the inheritance hierarchy above
@@ -32,24 +28,36 @@ typedef struct _InhPaths
        Oid                *supervec;           /* vector of superclasses */
 } InhPaths;
 
-/*
- *     This structure holds a list of possible functions or operators that
- *     agree with the known name and argument types of the function/operator.
- */
-typedef struct _CandidateList
+/* Result codes for func_get_detail */
+typedef enum
 {
-       Oid                *args;
-       struct _CandidateList *next;
-}                 *CandidateList;
+       FUNCDETAIL_NOTFOUND,            /* no suitable interpretation */
+       FUNCDETAIL_NORMAL,                      /* found a matching regular function */
+       FUNCDETAIL_AGGREGATE,           /* found a matching aggregate function */
+       FUNCDETAIL_COERCION                     /* it's a type coercion request */
+} FuncDetailCode;
+
+
+extern Node *ParseFuncOrColumn(ParseState *pstate,
+                                 List *funcname, List *fargs,
+                                 bool agg_star, bool agg_distinct, bool is_column);
+
+extern FuncDetailCode func_get_detail(List *funcname, List *fargs,
+                               int nargs, Oid *argtypes,
+                               Oid *funcid, Oid *rettype,
+                               bool *retset, Oid **true_typeids);
+
+extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
+
+extern void func_error(const char *caller, List *funcname,
+                                          int nargs, const Oid *argtypes,
+                                          const char *msg);
 
-extern Node *
-ParseNestedFuncOrColumn(ParseState *pstate, Attr *attr,
-                                               int *curr_resno, int precedence);
-extern Node *
-ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
-                                 int *curr_resno, int precedence);
+extern Oid     find_aggregate_func(const char *caller, List *aggname,
+                                                               Oid basetype);
 
-extern void
-func_error(char *caller, char *funcname, int nargs, Oid *argtypes, char *msg);
+extern Oid     LookupFuncName(List *funcname, int nargs, const Oid *argtypes);
+extern Oid     LookupFuncNameTypeNames(List *funcname, List *argtypes,
+                                                                       bool opaqueOK, const char *caller);
 
-#endif  /* PARSE_FUNC_H */
+#endif   /* PARSE_FUNC_H */