Are you sure that psql didn’t log any other error before that? This usually happens when a previous SQL command failed.
Also, why does the original database has duplicate records in the incoming_referers table? The unique index in that table exists since 2014. Maybe the database you are trying to restore has a lot more problems than this?