I moved my PostgresQL database from one hard drive to another using
pg_dump -U postgres db_name > db_name.dump
and then
psq
I encountered this problem. Then I realized that I forgot to install postgis extension.
postgis
Don't forget to install the extensions you use.