I need to duplicate the existing database including its schema and structure to another new database. I need this in shell command environment and not in pgadmin. Please kindly help me.
nohup pg_dump exampledb > example-01.sql
createdb -O postgres exampledbclone_01
my user is "postgres"
nohup psql exampledbclone_01 < example-01.sql
$ pg_dump mydb > db.sql
$ psql -d newdb -f db.sql