In case someone is checking for Mastodon index corruption following this tutorial https://docs.joinmastodon.org/admin/troubleshooting/index-corruption/
Depending on the version of amcheck you install you might need to use
'CREATE EXTENSION amcheck_next;'
instead of
'CREATE EXTENSION IF NOT EXISTS amcheck;'