1 /*-------------------------------------------------------------------------
4 * functions for working with object addresses
6 * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * src/include/catalog/objectaddress.h
11 *-------------------------------------------------------------------------
13 #ifndef OBJECTADDRESS_H
14 #define OBJECTADDRESS_H
16 #include "nodes/pg_list.h"
17 #include "storage/lock.h"
18 #include "utils/acl.h"
19 #include "utils/relcache.h"
22 * An ObjectAddress represents a database object of any type.
24 typedef struct ObjectAddress
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 */
31 extern ObjectAddress get_object_address(ObjectType objtype, List *objname,
32 List *objargs, Relation *relp,
33 LOCKMODE lockmode, bool missing_ok);
35 extern void check_object_ownership(Oid roleid,
36 ObjectType objtype, ObjectAddress address,
37 List *objname, List *objargs, Relation relation);
39 extern Oid get_object_namespace(const ObjectAddress *address);
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);
52 extern HeapTuple get_catalog_object_by_oid(Relation catalog,
55 extern char *getObjectDescription(const ObjectAddress *object);
56 extern char *getObjectDescriptionOids(Oid classid, Oid objid);
58 extern char *getObjectTypeDescription(const ObjectAddress *object);
59 extern char *getObjectIdentity(const ObjectAddress *address);
61 #endif /* OBJECTADDRESS_H */