pg_dump by default puts at the top
SET search_path = public,pg_catalog;
This considering a plain vanilla setup where no schemas other than public
have been created.
I however noticed that pg_dump also does this:
ALTER TABLE public.mytable OWNER TO pgsql;
Shouldn't the "public." be left out?
I verified that even if multiple tables exist with the same name only the
table in the first referenced schema in the path will be deleted.
By the same token shouldn't all references to schemas be left out?
In the case there are reasons why the schema is referenced, perhaps create a
parameter in pg_dump to omit the schema.
The rationale is to be able to easily move schemas in the target restore.
Specially if one was doing an entire database.
Alternatively is there any easy way to take all data in one schema and load
it into a target DB and a different schema?
The default produced by pg_dump would be a problem because of the "schema."
references.
As for why I am doing this schema move..