Forked from rgreenjr/postgres_queries_and_commands.sql
Last active
September 11, 2019 14:49
-
-
Save RodrigoCMoraes/e5eedfb2862cda0e46b324901710f4c7 to your computer and use it in GitHub Desktop.
Useful PostgreSQL Queries and Commands
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- all databases and their sizes | |
select * from pg_user; | |
-- Dump database on remote host to file | |
$ pg_dump -U username -h hostname databasename > dump.sql | |
-- Import dump into existing database | |
$ psql -d newdb -f dump.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment