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

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

How to create zip archives in nodejs

How to make a Snake Game using JavaScript and html5

How to draw clouds on HTML5 Canvas

How to resume a suspended web audio api context