OSDN Git Service

300b81d1f6913c011040d2767e5ecfcf2731c031
[pg-rex/syncrep.git] / src / include / catalog / objectaddress.h
1 /*-------------------------------------------------------------------------
2  *
3  * objectaddress.h
4  *        functions for working with object addresses
5  *
6  * Portions Copyright (c) 1996-2011, 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/parsenodes.h"
17 #include "storage/lock.h"
18 #include "utils/rel.h"
19
20 /*
21  * An ObjectAddress represents a database object of any type.
22  */
23 typedef struct ObjectAddress
24 {
25         Oid                     classId;                /* Class Id from pg_class */
26         Oid                     objectId;               /* OID of the object */
27         int32           objectSubId;    /* Subitem within object (eg column), or 0 */
28 } ObjectAddress;
29
30 extern ObjectAddress get_object_address(ObjectType objtype, List *objname,
31                                                                                 List *objargs, Relation *relp,
32                                                                                 LOCKMODE lockmode, bool missing_ok);
33
34 extern void check_object_ownership(Oid roleid,
35                                            ObjectType objtype, ObjectAddress address,
36                                            List *objname, List *objargs, Relation relation);
37
38 #endif   /* PARSE_OBJECT_H */