mirror of
https://github.com/postgres/postgres.git
synced 2025-09-02 04:21:28 +03:00
Allow extracting machine-readable object identity
Introduce pg_identify_object(oid,oid,int4), which is similar in spirit to pg_describe_object but instead produces a row of machine-readable information to uniquely identify the given object, without resorting to OIDs or other internal representation. This is intended to be used in the event trigger implementation, to report objects being operated on; but it has usefulness of its own. Catalog version bumped because of the new function.
This commit is contained in:
@@ -53,6 +53,6 @@
|
||||
*/
|
||||
|
||||
/* yyyymmddN */
|
||||
#define CATALOG_VERSION_NO 201303141
|
||||
#define CATALOG_VERSION_NO 201303201
|
||||
|
||||
#endif
|
||||
|
@@ -176,9 +176,6 @@ extern void recordDependencyOnSingleRelExpr(const ObjectAddress *depender,
|
||||
|
||||
extern ObjectClass getObjectClass(const ObjectAddress *object);
|
||||
|
||||
extern char *getObjectDescription(const ObjectAddress *object);
|
||||
extern char *getObjectDescriptionOids(Oid classid, Oid objid);
|
||||
|
||||
extern ObjectAddresses *new_object_addresses(void);
|
||||
|
||||
extern void add_exact_object_address(const ObjectAddress *object,
|
||||
|
@@ -38,6 +38,7 @@ extern void check_object_ownership(Oid roleid,
|
||||
|
||||
extern Oid get_object_namespace(const ObjectAddress *address);
|
||||
|
||||
extern bool is_objectclass_supported(Oid class_id);
|
||||
extern Oid get_object_oid_index(Oid class_id);
|
||||
extern int get_object_catcache_oid(Oid class_id);
|
||||
extern int get_object_catcache_name(Oid class_id);
|
||||
@@ -46,5 +47,15 @@ extern AttrNumber get_object_attnum_namespace(Oid class_id);
|
||||
extern AttrNumber get_object_attnum_owner(Oid class_id);
|
||||
extern AttrNumber get_object_attnum_acl(Oid class_id);
|
||||
extern AclObjectKind get_object_aclkind(Oid class_id);
|
||||
extern bool get_object_namensp_unique(Oid class_id);
|
||||
|
||||
#endif /* PARSE_OBJECT_H */
|
||||
extern HeapTuple get_catalog_object_by_oid(Relation catalog,
|
||||
Oid objectId);
|
||||
|
||||
extern char *getObjectDescription(const ObjectAddress *object);
|
||||
extern char *getObjectDescriptionOids(Oid classid, Oid objid);
|
||||
|
||||
extern char *getObjectTypeDescription(const ObjectAddress *object);
|
||||
extern char *getObjectIdentity(const ObjectAddress *address);
|
||||
|
||||
#endif /* OBJECTADDRESS_H */
|
||||
|
@@ -2917,6 +2917,9 @@ DESCR("view members of a multixactid");
|
||||
DATA(insert OID = 3537 ( pg_describe_object PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 25 "26 26 23" _null_ _null_ _null_ _null_ pg_describe_object _null_ _null_ _null_ ));
|
||||
DESCR("get identification of SQL object");
|
||||
|
||||
DATA(insert OID = 3839 ( pg_identify_object PGNSP PGUID 12 1 0 0 0 f f f f t f s 3 0 2249 "26 26 23" "{26,23,23,25,25,25,25}" "{i,i,i,o,o,o,o}" "{classid,objid,subobjid,type,schema,name,identity}" _null_ pg_identify_object _null_ _null_ _null_ ));
|
||||
DESCR("get machine-parseable identification of SQL object");
|
||||
|
||||
DATA(insert OID = 2079 ( pg_table_is_visible PGNSP PGUID 12 10 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_table_is_visible _null_ _null_ _null_ ));
|
||||
DESCR("is table visible in search path?");
|
||||
DATA(insert OID = 2080 ( pg_type_is_visible PGNSP PGUID 12 10 0 0 0 f f f f t f s 1 0 16 "26" _null_ _null_ _null_ _null_ pg_type_is_visible _null_ _null_ _null_ ));
|
||||
|
@@ -615,7 +615,9 @@ extern Datum regdictionarysend(PG_FUNCTION_ARGS);
|
||||
extern Datum text_regclass(PG_FUNCTION_ARGS);
|
||||
extern List *stringToQualifiedNameList(const char *string);
|
||||
extern char *format_procedure(Oid procedure_oid);
|
||||
extern char *format_procedure_qualified(Oid procedure_oid);
|
||||
extern char *format_operator(Oid operator_oid);
|
||||
extern char *format_operator_qualified(Oid operator_oid);
|
||||
|
||||
/* rowtypes.c */
|
||||
extern Datum record_in(PG_FUNCTION_ARGS);
|
||||
@@ -1027,6 +1029,7 @@ extern Datum pg_encoding_max_length_sql(PG_FUNCTION_ARGS);
|
||||
/* format_type.c */
|
||||
extern Datum format_type(PG_FUNCTION_ARGS);
|
||||
extern char *format_type_be(Oid type_oid);
|
||||
extern char *format_type_be_qualified(Oid type_oid);
|
||||
extern char *format_type_with_typemod(Oid type_oid, int32 typemod);
|
||||
extern Datum oidvectortypes(PG_FUNCTION_ARGS);
|
||||
extern int32 type_maximum_size(Oid type_oid, int32 typemod);
|
||||
@@ -1143,6 +1146,7 @@ extern Datum pg_get_multixact_members(PG_FUNCTION_ARGS);
|
||||
|
||||
/* catalogs/dependency.c */
|
||||
extern Datum pg_describe_object(PG_FUNCTION_ARGS);
|
||||
extern Datum pg_identify_object(PG_FUNCTION_ARGS);
|
||||
|
||||
/* commands/constraint.c */
|
||||
extern Datum unique_key_recheck(PG_FUNCTION_ARGS);
|
||||
|
Reference in New Issue
Block a user