- Change security settings for views to SECURITY INVOKER - Add explicit search_path in cleanup_old_spans function - Ensure safe, non-deferring access to trace views and cleanup routine