/Users/deen/code/yugabyte-db/src/postgres/src/include/catalog/catalog.h
Line | Count | Source |
1 | | /*------------------------------------------------------------------------- |
2 | | * |
3 | | * catalog.h |
4 | | * prototypes for functions in backend/catalog/catalog.c |
5 | | * |
6 | | * |
7 | | * Portions Copyright (c) 1996-2018, 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 | | #include "catalog/pg_class.h" |
18 | | #include "utils/relcache.h" |
19 | | |
20 | | /* |
21 | | * This OID corresponds to the next unused OID in the block of OIDs that are |
22 | | * used by YB specific catalog additions, starting at 8000. When making changes |
23 | | * to the catalog by adding a new OID in 'pg_*.dat', 'pg_*.h', 'toasting.h', or |
24 | | * 'indexing.h', make sure to increment this value. Additionally, the script |
25 | | * 'catalog/unused_oids' will help by outputting the blocks of unused OIDs to |
26 | | * validate that this value is up to date. |
27 | | * |
28 | | * If you increment it, make sure you didn't forget to add a new SQL migration |
29 | | * (see pg_yb_migration.dat and src/yb/yql/pgwrapper/ysql_migrations/README.md) |
30 | | */ |
31 | 118 | #define YB_MIN_UNUSED_OID 8040 |
32 | | |
33 | | extern bool IsSystemRelation(Relation relation); |
34 | | extern bool IsToastRelation(Relation relation); |
35 | | extern bool IsCatalogRelation(Relation relation); |
36 | | |
37 | | extern bool IsSystemClass(Oid relid, Form_pg_class reltuple); |
38 | | extern bool IsToastClass(Form_pg_class reltuple); |
39 | | extern bool IsCatalogClass(Oid relid, Form_pg_class reltuple); |
40 | | |
41 | | extern bool IsSystemNamespace(Oid namespaceId); |
42 | | extern bool YbIsSystemNamespaceByName(const char *namespace_name); |
43 | | extern bool IsToastNamespace(Oid namespaceId); |
44 | | |
45 | | extern bool IsReservedName(const char *name); |
46 | | |
47 | | extern bool IsSharedRelation(Oid relationId); |
48 | | |
49 | | extern Oid GetNewOid(Relation relation); |
50 | | extern Oid GetNewOidWithIndex(Relation relation, Oid indexId, |
51 | | AttrNumber oidcolumn); |
52 | | extern Oid GetNewRelFileNode(Oid reltablespace, Relation pg_class, |
53 | | char relpersistence); |
54 | | |
55 | | // TODO: Rename according to new style guide |
56 | | extern Oid GetTableOidFromRelOptions(List *relOptions, Oid reltablespace, |
57 | | char relpersistence); |
58 | | |
59 | | extern Oid GetRowTypeOidFromRelOptions(List *relOptions); |
60 | | |
61 | | extern Oid YbGetColocationIdFromRelOptions(List *relOptions); |
62 | | |
63 | | extern bool YbGetUseInitdbAclFromRelOptions(List *options); |
64 | | |
65 | | #endif /* CATALOG_H */ |