This should solve the problem if you are getting this error:
psql -U <username> -d <dbname> -f filename.sql
either pgrestore or psql will work based on the file type/dump command you have used.