Restore failed `entity2char already exists' RDS Postgres 13.7

Oh! So the issue is that the staging database has that function already, and the backup also has that function and it’s too stupid to understand that it’s the same function.

Maybe I should just drop and create the database on the staging/target site?

But your idea seems a bit easier.

EDIT: OK, I renamed the function and am doing the restore now. In about an hour I can see if it worked.

And the concern is that somehow the entity2char function that gets carried along in the backup will somehow not work with the existing database? Maybe I should just create a fresh new database and restore to it. I’m not a real fan of the name xx-discourse-database-5 anyway.

EDIT: Well, it looks like there are some more moles I will need to whack.

ERROR:  function "replace_mentions" already exists with same argument types

Maybe starting with a new database is the way to go.