2002-03-26 20:17:02 +01:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* namespace.h
|
|
|
|
* prototypes for functions in backend/catalog/namespace.c
|
|
|
|
*
|
|
|
|
*
|
2004-08-29 06:13:13 +02:00
|
|
|
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
|
2002-03-26 20:17:02 +01:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2004-08-29 07:07:03 +02:00
|
|
|
* $PostgreSQL: pgsql/src/include/catalog/namespace.h,v 1.33 2004/08/29 05:06:55 momjian Exp $
|
2002-03-26 20:17:02 +01:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
#ifndef NAMESPACE_H
|
|
|
|
#define NAMESPACE_H
|
|
|
|
|
|
|
|
#include "nodes/primnodes.h"
|
|
|
|
|
|
|
|
|
2002-04-06 08:59:25 +02:00
|
|
|
/*
|
|
|
|
* This structure holds a list of possible functions or operators
|
2002-09-04 22:31:48 +02:00
|
|
|
* found by namespace lookup. Each function/operator is identified
|
2002-04-06 08:59:25 +02:00
|
|
|
* by OID and by argument types; the list must be pruned by type
|
|
|
|
* resolution rules that are embodied in the parser, not here.
|
|
|
|
*/
|
|
|
|
typedef struct _FuncCandidateList
|
|
|
|
{
|
|
|
|
struct _FuncCandidateList *next;
|
|
|
|
int pathpos; /* for internal use of namespace lookup */
|
|
|
|
Oid oid; /* the function or operator's OID */
|
2002-04-25 04:56:56 +02:00
|
|
|
int nargs; /* number of arg types returned */
|
2002-04-06 08:59:25 +02:00
|
|
|
Oid args[1]; /* arg types --- VARIABLE LENGTH ARRAY */
|
2002-09-04 22:31:48 +02:00
|
|
|
} *FuncCandidateList; /* VARIABLE LENGTH STRUCT */
|
2002-04-06 08:59:25 +02:00
|
|
|
|
2002-04-17 22:57:57 +02:00
|
|
|
/*
|
|
|
|
* This structure holds a list of opclass candidates found by namespace
|
|
|
|
* lookup.
|
|
|
|
*/
|
|
|
|
typedef struct _OpclassCandidateList
|
|
|
|
{
|
|
|
|
struct _OpclassCandidateList *next;
|
|
|
|
char *opcname_tmp; /* for internal use of namespace lookup */
|
|
|
|
int pathpos; /* for internal use of namespace lookup */
|
|
|
|
Oid oid; /* the opclass's OID */
|
2003-11-12 22:15:59 +01:00
|
|
|
Oid opcintype; /* type of data indexed by opclass */
|
2002-04-17 22:57:57 +02:00
|
|
|
bool opcdefault; /* T if opclass is default for opcintype */
|
2003-11-12 22:15:59 +01:00
|
|
|
Oid opckeytype; /* type of data in index, or InvalidOid */
|
2002-09-04 22:31:48 +02:00
|
|
|
} *OpclassCandidateList;
|
2002-04-17 22:57:57 +02:00
|
|
|
|
2002-04-06 08:59:25 +02:00
|
|
|
|
2002-03-26 20:17:02 +01:00
|
|
|
extern Oid RangeVarGetRelid(const RangeVar *relation, bool failOK);
|
|
|
|
extern Oid RangeVarGetCreationNamespace(const RangeVar *newRelation);
|
|
|
|
extern Oid RelnameGetRelid(const char *relname);
|
2002-05-02 01:06:41 +02:00
|
|
|
extern bool RelationIsVisible(Oid relid);
|
2002-03-26 20:17:02 +01:00
|
|
|
|
2002-03-30 02:02:42 +01:00
|
|
|
extern Oid TypenameGetTypid(const char *typname);
|
2002-05-02 01:06:41 +02:00
|
|
|
extern bool TypeIsVisible(Oid typid);
|
2002-04-17 22:57:57 +02:00
|
|
|
|
2002-04-06 08:59:25 +02:00
|
|
|
extern FuncCandidateList FuncnameGetCandidates(List *names, int nargs);
|
2002-05-02 01:06:41 +02:00
|
|
|
extern bool FunctionIsVisible(Oid funcid);
|
2002-04-06 08:59:25 +02:00
|
|
|
|
2002-04-17 01:08:12 +02:00
|
|
|
extern FuncCandidateList OpernameGetCandidates(List *names, char oprkind);
|
2002-05-02 01:06:41 +02:00
|
|
|
extern bool OperatorIsVisible(Oid oprid);
|
2002-04-17 01:08:12 +02:00
|
|
|
|
2002-04-17 22:57:57 +02:00
|
|
|
extern OpclassCandidateList OpclassGetCandidates(Oid amid);
|
2002-05-02 01:06:41 +02:00
|
|
|
extern Oid OpclassnameGetOpcid(Oid amid, const char *opcname);
|
|
|
|
extern bool OpclassIsVisible(Oid opcid);
|
2003-01-07 21:56:07 +01:00
|
|
|
|
2002-12-12 22:02:25 +01:00
|
|
|
extern Oid ConversionGetConid(const char *conname);
|
2003-01-07 21:56:07 +01:00
|
|
|
extern bool ConversionIsVisible(Oid conid);
|
2002-04-17 22:57:57 +02:00
|
|
|
|
2002-07-30 01:46:35 +02:00
|
|
|
extern void DeconstructQualifiedName(List *names,
|
2002-09-04 22:31:48 +02:00
|
|
|
char **nspname_p,
|
|
|
|
char **objname_p);
|
2002-08-08 03:44:31 +02:00
|
|
|
extern Oid LookupExplicitNamespace(const char *nspname);
|
2002-07-30 01:46:35 +02:00
|
|
|
|
2002-03-29 20:06:29 +01:00
|
|
|
extern Oid QualifiedNameGetCreationNamespace(List *names, char **objname_p);
|
|
|
|
extern RangeVar *makeRangeVarFromNameList(List *names);
|
2002-04-09 22:35:55 +02:00
|
|
|
extern char *NameListToString(List *names);
|
2002-11-02 19:41:22 +01:00
|
|
|
extern char *NameListToQuotedString(List *names);
|
2002-04-09 22:35:55 +02:00
|
|
|
|
2002-03-31 08:26:32 +02:00
|
|
|
extern bool isTempNamespace(Oid namespaceId);
|
2002-09-23 22:43:41 +02:00
|
|
|
extern bool isOtherTempNamespace(Oid namespaceId);
|
2002-03-31 08:26:32 +02:00
|
|
|
|
2002-05-17 22:53:33 +02:00
|
|
|
extern void PushSpecialNamespace(Oid namespaceId);
|
|
|
|
extern void PopSpecialNamespace(Oid namespaceId);
|
|
|
|
|
2002-09-04 22:31:48 +02:00
|
|
|
extern Oid FindConversionByName(List *conname);
|
|
|
|
extern Oid FindDefaultConversionProc(int4 for_encoding, int4 to_encoding);
|
2002-07-16 08:58:14 +02:00
|
|
|
|
2002-05-17 22:53:33 +02:00
|
|
|
/* initialization & transaction cleanup code */
|
|
|
|
extern void InitializeSearchPath(void);
|
|
|
|
extern void AtEOXact_Namespace(bool isCommit);
|
2004-07-28 16:23:31 +02:00
|
|
|
extern void AtEOSubXact_Namespace(bool isCommit, TransactionId myXid,
|
2004-08-29 07:07:03 +02:00
|
|
|
TransactionId parentXid);
|
2002-05-17 22:53:33 +02:00
|
|
|
|
2002-04-01 05:34:27 +02:00
|
|
|
/* stuff for search_path GUC variable */
|
|
|
|
extern char *namespace_search_path;
|
|
|
|
|
2002-05-17 22:53:33 +02:00
|
|
|
extern List *fetch_search_path(bool includeImplicit);
|
2002-04-26 03:24:08 +02:00
|
|
|
|
2002-03-26 20:17:02 +01:00
|
|
|
#endif /* NAMESPACE_H */
|