how to dump a postgresql database using from the terminal

PostgreSQL is a relational database management system and arguably the best database management around. postgreSQL comes with utilities used to manipulate databases from the terminal "psql" being the most popular utility I'm sure you've read somewhere or used "psql"

dumping "backing" databases is done using PostgreSQL's pg_dump utility

In your terminal type;
pg_dump <database name> > <output>

For instance to backup a database named "books" to a file named "books.sql" do;

pg_dump "books" > books.sql

How to exclude database data from backups

To exclude database data from your output file you should include "-s" flag in your command

pg_dump -s "books" > books.sql


Popular posts from this blog

Snake monochrome (JS1024)

How to set content disposition header for nginx server to force content download

Solutions to blocked URLs on Facebook

How to make a Snake Game using JavaScript and html5

How to remove null elements from array in JavaScript