OSDN Git Service

Implement types regprocedure, regoper, regoperator, regclass, regtype
[pg-rex/syncrep.git] / src / include / catalog / namespace.h
1 /*-------------------------------------------------------------------------
2  *
3  * namespace.h
4  *        prototypes for functions in backend/catalog/namespace.c
5  *
6  *
7  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: namespace.h,v 1.10 2002/04/25 02:56:56 tgl Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef NAMESPACE_H
15 #define NAMESPACE_H
16
17 #include "nodes/primnodes.h"
18
19
20 /*
21  *      This structure holds a list of possible functions or operators
22  *      found by namespace lookup.  Each function/operator is identified
23  *      by OID and by argument types; the list must be pruned by type
24  *      resolution rules that are embodied in the parser, not here.
25  */
26 typedef struct _FuncCandidateList
27 {
28         struct _FuncCandidateList *next;
29         int                     pathpos;                /* for internal use of namespace lookup */
30         Oid                     oid;                    /* the function or operator's OID */
31         int                     nargs;                  /* number of arg types returned */
32         Oid                     args[1];                /* arg types --- VARIABLE LENGTH ARRAY */
33 } *FuncCandidateList;                   /* VARIABLE LENGTH STRUCT */
34
35 /*
36  *      This structure holds a list of opclass candidates found by namespace
37  *      lookup.
38  */
39 typedef struct _OpclassCandidateList
40 {
41         struct _OpclassCandidateList *next;
42         char       *opcname_tmp;        /* for internal use of namespace lookup */
43         int                     pathpos;                /* for internal use of namespace lookup */
44         Oid                     oid;                    /* the opclass's OID */
45         Oid                     opcintype;              /* type of input data for opclass */
46         bool            opcdefault;             /* T if opclass is default for opcintype */
47         Oid                     opckeytype;             /* type of index data, or InvalidOid */
48 } *OpclassCandidateList;
49
50
51 extern Oid      RangeVarGetRelid(const RangeVar *relation, bool failOK);
52
53 extern Oid      RangeVarGetCreationNamespace(const RangeVar *newRelation);
54
55 extern Oid      RelnameGetRelid(const char *relname);
56
57 extern Oid      TypenameGetTypid(const char *typname);
58
59 extern Oid      OpclassnameGetOpcid(Oid amid, const char *opcname);
60
61 extern FuncCandidateList FuncnameGetCandidates(List *names, int nargs);
62
63 extern FuncCandidateList OpernameGetCandidates(List *names, char oprkind);
64
65 extern OpclassCandidateList OpclassGetCandidates(Oid amid);
66
67 extern Oid      QualifiedNameGetCreationNamespace(List *names, char **objname_p);
68
69 extern RangeVar *makeRangeVarFromNameList(List *names);
70
71 extern char *NameListToString(List *names);
72
73 extern bool isTempNamespace(Oid namespaceId);
74
75 /* stuff for search_path GUC variable */
76 extern char *namespace_search_path;
77
78 extern bool check_search_path(const char *proposed);
79 extern void assign_search_path(const char *newval);
80 extern void InitializeSearchPath(void);
81
82 #endif   /* NAMESPACE_H */