/* * sepgsql_object_access * * Entrypoint of the object_access_hook. This routine performs as * a dispatcher of invocation based on access type and object classes. */ static void sepgsql_object_access(ObjectAccessType access, Oid classId, Oid objectId, int subId) { if (next_object_access_hook) (*next_object_access_hook) (access, classId, objectId, subId); switch (access) { case OAT_POST_CREATE: switch (classId) { case DatabaseRelationId: sepgsql_database_post_create(objectId); break; case NamespaceRelationId: sepgsql_schema_post_create(objectId); break; case RelationRelationId: if (subId == 0) sepgsql_relation_post_create(objectId); else sepgsql_attribute_post_create(objectId, subId); break; case ProcedureRelationId: sepgsql_proc_post_create(objectId); break; default: /* Ignore unsupported object classes */ break; } break; default: elog(ERROR, "unexpected object access type: %d", (int) access); break; } }
/* * sepgsql_object_access * * Entrypoint of the objacc_hook. This routine performs as * a dispatcher of invocation based on access type and object classes. */ static void sepgsql_object_access(enum objacc_type access, oid_t classId, oid_t objectId, int subId) { if (next_objacc_hook) (*next_objacc_hook) (access, classId, objectId, subId); switch (access) { case OAT_POST_CREATE: switch (classId) { case NAMESPACE_RELATION_ID: sepgsql_schema_post_create(objectId); break; case RelationRelationId: if (subId == 0) sepgsql_relation_post_create(objectId); else sepgsql_attribute_post_create(objectId, subId); break; case ProcedureRelationId: sepgsql_proc_post_create(objectId); break; default: /* Ignore unsupported object classes */ break; } break; default: elog(ERROR, "unexpected object access type: %d", (int) access); break; } }