Advertisement
Guest User

Untitled

a guest
Oct 14th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. # linux
  2. PGPASSWORD="password" pg_dump -h host -p port -U username database > file.sql
  3.  
  4. # windows (NO SPACE between 'password' and '&&')
  5. SET PGPASSWORD=password&& pg_dump -h host -p port -U username database > file.sql
  6.  
  7. # alternative
  8. pg_dump --dbname=postgresql://username:password@host:port/database > file.sql
  9.  
  10. # restore
  11. psql -U postgres database < file.sql
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement