OSDN Git Service

rebuid:
[eos/hostdependX86MAC64.git] / util / X86MAC64 / include / postgresql / server / catalog / objectaddress.h
1 /*-------------------------------------------------------------------------
2  *
3  * objectaddress.h
4  *        functions for working with object addresses
5  *
6  * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/catalog/objectaddress.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef OBJECTADDRESS_H
14 #define OBJECTADDRESS_H
15
16 #include "nodes/pg_list.h"
17 #include "storage/lock.h"
18 #include "utils/acl.h"
19 #include "utils/relcache.h"
20
21 /*
22  * An ObjectAddress represents a database object of any type.
23  */
24 typedef struct ObjectAddress
25 {
26         Oid                     classId;                /* Class Id from pg_class */
27         Oid                     objectId;               /* OID of the object */
28         int32           objectSubId;    /* Subitem within object (eg column), or 0 */
29 } ObjectAddress;
30
31 extern ObjectAddress get_object_address(ObjectType objtype, List *objname,
32                                    List *objargs, Relation *relp,
33                                    LOCKMODE lockmode, bool missing_ok);
34
35 extern void check_object_ownership(Oid roleid,
36                                            ObjectType objtype, ObjectAddress address,
37                                            List *objname, List *objargs, Relation relation);
38
39 extern Oid      get_object_namespace(const ObjectAddress *address);
40
41 extern bool is_objectclass_supported(Oid class_id);
42 extern Oid      get_object_oid_index(Oid class_id);
43 extern int      get_object_catcache_oid(Oid class_id);
44 extern int      get_object_catcache_name(Oid class_id);
45 extern AttrNumber get_object_attnum_name(Oid class_id);
46 extern AttrNumber get_object_attnum_namespace(Oid class_id);
47 extern AttrNumber get_object_attnum_owner(Oid class_id);
48 extern AttrNumber get_object_attnum_acl(Oid class_id);
49 extern AclObjectKind get_object_aclkind(Oid class_id);
50 extern bool get_object_namensp_unique(Oid class_id);
51
52 extern HeapTuple get_catalog_object_by_oid(Relation catalog,
53                                                   Oid objectId);
54
55 extern char *getObjectDescription(const ObjectAddress *object);
56 extern char *getObjectDescriptionOids(Oid classid, Oid objid);
57
58 extern char *getObjectTypeDescription(const ObjectAddress *object);
59 extern char *getObjectIdentity(const ObjectAddress *address);
60
61 #endif   /* OBJECTADDRESS_H */