Header And Logo

PostgreSQL
| The world's most advanced open source database.

objectaddress.h

Go to the documentation of this file.
00001 /*-------------------------------------------------------------------------
00002  *
00003  * objectaddress.h
00004  *    functions for working with object addresses
00005  *
00006  * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group
00007  * Portions Copyright (c) 1994, Regents of the University of California
00008  *
00009  * src/include/catalog/objectaddress.h
00010  *
00011  *-------------------------------------------------------------------------
00012  */
00013 #ifndef OBJECTADDRESS_H
00014 #define OBJECTADDRESS_H
00015 
00016 #include "nodes/pg_list.h"
00017 #include "storage/lock.h"
00018 #include "utils/acl.h"
00019 #include "utils/relcache.h"
00020 
00021 /*
00022  * An ObjectAddress represents a database object of any type.
00023  */
00024 typedef struct ObjectAddress
00025 {
00026     Oid         classId;        /* Class Id from pg_class */
00027     Oid         objectId;       /* OID of the object */
00028     int32       objectSubId;    /* Subitem within object (eg column), or 0 */
00029 } ObjectAddress;
00030 
00031 extern ObjectAddress get_object_address(ObjectType objtype, List *objname,
00032                    List *objargs, Relation *relp,
00033                    LOCKMODE lockmode, bool missing_ok);
00034 
00035 extern void check_object_ownership(Oid roleid,
00036                        ObjectType objtype, ObjectAddress address,
00037                        List *objname, List *objargs, Relation relation);
00038 
00039 extern Oid  get_object_namespace(const ObjectAddress *address);
00040 
00041 extern bool             is_objectclass_supported(Oid class_id);
00042 extern Oid              get_object_oid_index(Oid class_id);
00043 extern int              get_object_catcache_oid(Oid class_id);
00044 extern int              get_object_catcache_name(Oid class_id);
00045 extern AttrNumber       get_object_attnum_name(Oid class_id);
00046 extern AttrNumber       get_object_attnum_namespace(Oid class_id);
00047 extern AttrNumber       get_object_attnum_owner(Oid class_id);
00048 extern AttrNumber       get_object_attnum_acl(Oid class_id);
00049 extern AclObjectKind    get_object_aclkind(Oid class_id);
00050 extern bool             get_object_namensp_unique(Oid class_id);
00051 
00052 extern HeapTuple        get_catalog_object_by_oid(Relation catalog,
00053                           Oid objectId);
00054 
00055 extern char *getObjectDescription(const ObjectAddress *object);
00056 extern char *getObjectDescriptionOids(Oid classid, Oid objid);
00057 
00058 extern char *getObjectTypeDescription(const ObjectAddress *object);
00059 extern char *getObjectIdentity(const ObjectAddress *address);
00060 
00061 #endif   /* OBJECTADDRESS_H */