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

Comments

Popular posts from this blog

FlappingBird Postmortem (JS13K)

JavaScript introduction to variables

FlappingBird JS13K Games

How to target all elements of a given class name in JavaScript

Zedplug will be decommissioned on November 30th