~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to src/include/parser/parse_func.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * parse_func.h
 
4
 *
 
5
 *
 
6
 *
 
7
 * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
 
8
 * Portions Copyright (c) 1994, Regents of the University of California
 
9
 *
 
10
 * $PostgreSQL$
 
11
 *
 
12
 *-------------------------------------------------------------------------
 
13
 */
 
14
#ifndef PARSER_FUNC_H
 
15
#define PARSER_FUNC_H
 
16
 
 
17
#include "catalog/namespace.h"
 
18
#include "parser/parse_node.h"
 
19
 
 
20
 
 
21
/*
 
22
 *      This structure is used to explore the inheritance hierarchy above
 
23
 *      nodes in the type tree in order to disambiguate among polymorphic
 
24
 *      functions.
 
25
 */
 
26
typedef struct _InhPaths
 
27
{
 
28
        int                     nsupers;                /* number of superclasses */
 
29
        Oid                     self;                   /* this class */
 
30
        Oid                *supervec;           /* vector of superclasses */
 
31
} InhPaths;
 
32
 
 
33
/* Result codes for func_get_detail */
 
34
typedef enum
 
35
{
 
36
        FUNCDETAIL_NOTFOUND,            /* no matching function */
 
37
        FUNCDETAIL_MULTIPLE,            /* too many matching functions */
 
38
        FUNCDETAIL_NORMAL,                      /* found a matching regular function */
 
39
        FUNCDETAIL_AGGREGATE,           /* found a matching aggregate function */
 
40
        FUNCDETAIL_WINDOWFUNC,          /* found a matching window function */
 
41
        FUNCDETAIL_COERCION                     /* it's a type coercion request */
 
42
} FuncDetailCode;
 
43
 
 
44
 
 
45
extern Node *ParseFuncOrColumn(ParseState *pstate,
 
46
                                  List *funcname, List *fargs,
 
47
                                  bool agg_star, bool agg_distinct, bool func_variadic,
 
48
                                  WindowDef *over, bool is_column, int location);
 
49
 
 
50
extern FuncDetailCode func_get_detail(List *funcname, List *fargs,
 
51
                                int nargs, Oid *argtypes,
 
52
                                bool expand_variadic, bool expand_defaults,
 
53
                                Oid *funcid, Oid *rettype,
 
54
                                bool *retset, int *nvargs, Oid **true_typeids,
 
55
                                List **argdefaults);
 
56
 
 
57
extern int func_match_argtypes(int nargs,
 
58
                                        Oid *input_typeids,
 
59
                                        FuncCandidateList raw_candidates,
 
60
                                        FuncCandidateList *candidates);
 
61
 
 
62
extern FuncCandidateList func_select_candidate(int nargs,
 
63
                                          Oid *input_typeids,
 
64
                                          FuncCandidateList candidates);
 
65
 
 
66
extern bool typeInheritsFrom(Oid subclassTypeId, Oid superclassTypeId);
 
67
 
 
68
extern void make_fn_arguments(ParseState *pstate,
 
69
                                  List *fargs,
 
70
                                  Oid *actual_arg_types,
 
71
                                  Oid *declared_arg_types);
 
72
 
 
73
extern const char *funcname_signature_string(const char *funcname,
 
74
                                                  int nargs, const Oid *argtypes);
 
75
extern const char *func_signature_string(List *funcname,
 
76
                                          int nargs, const Oid *argtypes);
 
77
 
 
78
extern Oid LookupFuncName(List *funcname, int nargs, const Oid *argtypes,
 
79
                           bool noError);
 
80
extern Oid LookupFuncNameTypeNames(List *funcname, List *argtypes,
 
81
                                                bool noError);
 
82
extern Oid LookupAggNameTypeNames(List *aggname, List *argtypes,
 
83
                                           bool noError);
 
84
 
 
85
#endif   /* PARSE_FUNC_H */