PostgreSQL – Make a copy of a schema in the same database

# dump the schema into a text file as user 'postgres'
pg_dump -h localhost -n source_schema -U postgres db_name > dump.sql
# change all instances of source_schema in the dump into new_schema
sed -i 's/source_schema/new_schema/g' dump.sql
# skip all GRANT statements in the dump by commenting out
sed -i 's/GRANT/-- GRANT/g' dump.sql
# feed the dump file into psql to create new_schema as user 'postgres'
psql -h localhost -f dump.sql -U postgres db_name
# remove the dump file to clean up the file system
rm dump.sql

Some other ways: