PostgreSQL : Useful command line tips

How to access my postgree ?

$psql -h server -U userName


 How to list my existing databases ?

$\l


 How to connect in some database ?

$\c databaseName


How to make a backup ?

$pg_dump databaseName -h localhost -U postgres > backup.sql

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s