Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
postgresql [2019/10/14 10:30]
jdx [Cheatsheet]
postgresql [2019/10/14 10:32] (current)
jdx [Cheatsheet]
Line 9: Line 9:
  
 # connect # connect
-psql -h <server_name> -p 5432 -U <​username>​ -d <​dbname>​ -W+psql -h <hostname> -p 5432 -U <​username>​ -d <​dbname>​ -W
  
 \l  # list databases \l  # list databases
Line 15: Line 15:
 \dt  # list tables \dt  # list tables
  
-</code>+# dumpĀ 
 +pg_dump -h <hostname>​ -p 5432 -U postgre -W -F t <​dbname>​ > ./<​dumpname>.tar
  
 +# restore
 +pg_restore -d <​dbname>​ ./<​dumpname>​.tar -c -U <​username>​ -h <​hostname>​ -p 5432
  
 +</​code>​
  
 ===== Links ===== ===== Links =====
  • postgresql.txt
  • Last modified: 2019/10/14 10:32
  • by jdx