It looks like there is CASCADE missing in app_remove_context()
When we try to call hive._app_remove_context()
, we get an error when there are some dependencies on the HAF application tables in its application schema
ERROR: cannot drop column hive_rowid of table hivemind_app.hive_posts because other objects depend on it
DETAIL: view live_posts_comments_view depends on column hive_rowid of table hivemind_app.hive_posts
view live_posts_view depends on view live_posts_comments_view
view live_comments_view depends on view live_posts_comments_view
HINT: Use DROP ... CASCADE to drop the dependent objects too.
CONTEXT: SQL statement "ALTER TABLE hivemind_app.hive_posts DROP COLUMN hive_rowid"
PL/pgSQL function hive.unregister_table(text,text) line 46 at EXECUTE
SQL statement "SELECT hive.unregister_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_remove(hive.context_name) line 11 at PERFORM
SQL statement "SELECT hive.context_remove( _name )"
PL/pgSQL function hive.app_remove_context(hive.context_name) line 4 at PERFORM
SQL state: 2BP01