I'd personally even prefer using checked_pointer_cast when retrieving database objects from schema - there is no need for further evaluation via isIndex or isTable.