I have db named "mydb". Now How can I create a new db with name "mydb_test" with only schema of "mydb"
Tried the following link PostgreSQL how to create a copy of a database or schema?
As mentioned over there I tried the following command,
createdb -T olddb newdb
This copies including the data into newdb
If I try the second option mentioned in the above link I get following error,
# pg_dump -Cs -U postgres my_test_db > dump_schema_file
# psql -U postgres naggappan_my_test_db < dump_schema_file
psql: FATAL: database "naggappan_my_test_db" does not exist
How can I take only schema