I want to copy my database schema (just schema ;not data) from internal server to external server. The problem I am facing is entering passwords at every step. Even though the steps to copy are pretty simple, I am not able to generate a script to automate teh whole process.
What I have till now:
on internal server:
pg_dump -C -s --file=schema.txt {name}
scp schema.txt prakhar@{external server}:/home/prakhar
on external server:
dropdb {name}
createdb {name}
psql --file=schema.txt {name}
At each step I am prompted for password. I want to do two things: 1: Run the script from external server to fetch schema from internal ; or the other way around 2: Incorporate the password for both internal and external servers in a way the the script takes care of it for me.