1
/*-------------------------------------------------------------------------
4
* prototypes for functions in backend/catalog/namespace.c
7
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
8
* Portions Copyright (c) 1994, Regents of the University of California
10
* $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.35 2004-12-31 22:03:24 pgsql 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 data indexed by opclass */
46
bool opcdefault; /* T if opclass is default for opcintype */
47
Oid opckeytype; /* type of data in index, or InvalidOid */
48
} *OpclassCandidateList;
51
extern Oid RangeVarGetRelid(const RangeVar *relation, bool failOK);
52
extern Oid RangeVarGetCreationNamespace(const RangeVar *newRelation);
53
extern Oid RelnameGetRelid(const char *relname);
54
extern bool RelationIsVisible(Oid relid);
56
extern Oid TypenameGetTypid(const char *typname);
57
extern bool TypeIsVisible(Oid typid);
59
extern FuncCandidateList FuncnameGetCandidates(List *names, int nargs);
60
extern bool FunctionIsVisible(Oid funcid);
62
extern FuncCandidateList OpernameGetCandidates(List *names, char oprkind);
63
extern bool OperatorIsVisible(Oid oprid);
65
extern OpclassCandidateList OpclassGetCandidates(Oid amid);
66
extern Oid OpclassnameGetOpcid(Oid amid, const char *opcname);
67
extern bool OpclassIsVisible(Oid opcid);
69
extern Oid ConversionGetConid(const char *conname);
70
extern bool ConversionIsVisible(Oid conid);
72
extern void DeconstructQualifiedName(List *names,
75
extern Oid LookupExplicitNamespace(const char *nspname);
77
extern Oid QualifiedNameGetCreationNamespace(List *names, char **objname_p);
78
extern RangeVar *makeRangeVarFromNameList(List *names);
79
extern char *NameListToString(List *names);
80
extern char *NameListToQuotedString(List *names);
82
extern bool isTempNamespace(Oid namespaceId);
83
extern bool isOtherTempNamespace(Oid namespaceId);
85
extern void PushSpecialNamespace(Oid namespaceId);
86
extern void PopSpecialNamespace(Oid namespaceId);
88
extern Oid FindConversionByName(List *conname);
89
extern Oid FindDefaultConversionProc(int4 for_encoding, int4 to_encoding);
91
/* initialization & transaction cleanup code */
92
extern void InitializeSearchPath(void);
93
extern void AtEOXact_Namespace(bool isCommit);
94
extern void AtEOSubXact_Namespace(bool isCommit, SubTransactionId mySubid,
95
SubTransactionId parentSubid);
97
/* stuff for search_path GUC variable */
98
extern char *namespace_search_path;
100
extern List *fetch_search_path(bool includeImplicit);
102
#endif /* NAMESPACE_H */