hive.app_context_detach('the_app'); does not work when HAF broken app died
The reason are filled shadow tables. Even app_context_detach implementation suggest to squash events and throw away such reversible data it does not work and following exception is generated:
ERROR: Cannot detach a table hivemind_app.hive_accounts. Shadow table hive.shadow_hivemind_app_hive_accounts is not empty CONTEXT: PL/pgSQL function hive.detach_table(text,text) line 19 at RAISE SQL statement "SELECT hive.detach_table( hrt.origin_table_schema, hrt.origin_table_name ) FROM hive.registered_tables hrt WHERE hrt.context_id = __context_id" PL/pgSQL function hive.context_detach(text) line 11 at PERFORM SQL statement "SELECT hive.context_detach( _context )" PL/pgSQL function hive.app_context_detach(text) line 3 at PERFORM SQL state: P0001