PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
catalog.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * catalog.h
4  * prototypes for functions in backend/catalog/catalog.c
5  *
6  *
7  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * src/include/catalog/catalog.h
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef CATALOG_H
15 #define CATALOG_H
16 
17 /*
18  * 'pgrminclude ignore' needed here because CppAsString2() does not throw
19  * an error if the symbol is not defined.
20  */
21 #include "catalog/catversion.h" /* pgrminclude ignore */
22 #include "catalog/pg_class.h"
23 #include "utils/relcache.h"
24 
25 #define OIDCHARS 10 /* max chars printed by %u */
26 #define TABLESPACE_VERSION_DIRECTORY "PG_" PG_MAJORVERSION "_" \
27  CppAsString2(CATALOG_VERSION_NO)
28 
29 
30 extern bool IsSystemRelation(Relation relation);
31 extern bool IsToastRelation(Relation relation);
32 extern bool IsCatalogRelation(Relation relation);
33 
34 extern bool IsSystemClass(Oid relid, Form_pg_class reltuple);
35 extern bool IsToastClass(Form_pg_class reltuple);
36 extern bool IsCatalogClass(Oid relid, Form_pg_class reltuple);
37 
38 extern bool IsSystemNamespace(Oid namespaceId);
39 extern bool IsToastNamespace(Oid namespaceId);
40 
41 extern bool IsReservedName(const char *name);
42 
43 extern bool IsSharedRelation(Oid relationId);
44 
45 extern Oid GetNewOid(Relation relation);
46 extern Oid GetNewOidWithIndex(Relation relation, Oid indexId,
47  AttrNumber oidcolumn);
48 extern Oid GetNewRelFileNode(Oid reltablespace, Relation pg_class,
49  char relpersistence);
50 
51 #endif /* CATALOG_H */
bool IsToastNamespace(Oid namespaceId)
Definition: catalog.c:177
unsigned int Oid
Definition: postgres_ext.h:31
bool IsSystemClass(Oid relid, Form_pg_class reltuple)
Definition: catalog.c:75
bool IsSharedRelation(Oid relationId)
Definition: catalog.c:220
Oid GetNewOid(Relation relation)
Definition: catalog.c:289
bool IsCatalogRelation(Relation relation)
Definition: catalog.c:92
Oid GetNewRelFileNode(Oid reltablespace, Relation pg_class, char relpersistence)
Definition: catalog.c:395
bool IsReservedName(const char *name)
Definition: catalog.c:194
bool IsCatalogClass(Oid relid, Form_pg_class reltuple)
Definition: catalog.c:104
bool IsSystemNamespace(Oid namespaceId)
Definition: catalog.c:163
const char * name
Definition: encode.c:521
Oid GetNewOidWithIndex(Relation relation, Oid indexId, AttrNumber oidcolumn)
Definition: catalog.c:336
bool IsToastRelation(Relation relation)
Definition: catalog.c:136
FormData_pg_class * Form_pg_class
Definition: pg_class.h:95
bool IsSystemRelation(Relation relation)
Definition: catalog.c:63
int16 AttrNumber
Definition: attnum.h:21
bool IsToastClass(Form_pg_class reltuple)
Definition: catalog.c:148