Changing the target schema on export or import? I normally do the following for SQL dumps:
pg_dump -U username -cOx database &gt; dump.sql

And then restore it into a new database with:
psql -U username new_database &lt; dump.sql

Currently the database tables are not in the public schema, but a schema named for a user. No reason for it. I think it happened when there was a migration from MySQL to PostgreSQL a few years back using a utility whose name escapes me.
I'd like to move everything into public. I know I can do this by editing the dump.sql, which is a slow process given the size of the file (which is pretty small in database terms).
Is there a way to do this when exporting or importing a SQL dump?
This is PostgreSQL 13, btw.
There is no direct way to do this.
You could for example restore the dump into a temporary database, drop the public schema there, rename your schema to public and then dump again.