1 /*-------------------------------------------------------------------------
4 * prototypes for functions in backend/catalog/namespace.c
7 * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * $Id: namespace.h,v 1.10 2002/04/25 02:56:56 tgl Exp $
12 *-------------------------------------------------------------------------
17 #include "nodes/primnodes.h"
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.
26 typedef struct _FuncCandidateList
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 */
36 * This structure holds a list of opclass candidates found by namespace
39 typedef struct _OpclassCandidateList
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;
51 extern Oid RangeVarGetRelid(const RangeVar *relation, bool failOK);
53 extern Oid RangeVarGetCreationNamespace(const RangeVar *newRelation);
55 extern Oid RelnameGetRelid(const char *relname);
57 extern Oid TypenameGetTypid(const char *typname);
59 extern Oid OpclassnameGetOpcid(Oid amid, const char *opcname);
61 extern FuncCandidateList FuncnameGetCandidates(List *names, int nargs);
63 extern FuncCandidateList OpernameGetCandidates(List *names, char oprkind);
65 extern OpclassCandidateList OpclassGetCandidates(Oid amid);
67 extern Oid QualifiedNameGetCreationNamespace(List *names, char **objname_p);
69 extern RangeVar *makeRangeVarFromNameList(List *names);
71 extern char *NameListToString(List *names);
73 extern bool isTempNamespace(Oid namespaceId);
75 /* stuff for search_path GUC variable */
76 extern char *namespace_search_path;
78 extern bool check_search_path(const char *proposed);
79 extern void assign_search_path(const char *newval);
80 extern void InitializeSearchPath(void);
82 #endif /* NAMESPACE_H */