Last active
October 20, 2017 20:15
-
-
Save bitlather/5fb3d01fe404e75ecbc846496e00ea7a to your computer and use it in GitHub Desktop.
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
PostgreSQL 9.3.14 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4, 64-bit | |
sudo su - postgres | |
Run 'psql' to connect, or 'psql -E' to connect and show psql queries. | |
Commands: | |
\l | List databases | |
\connect db_name | Use db_name database | |
\dt | List tables | |
\dv | List views | |
\dtv | List tables & views | |
SELECT * FROM schema_version; | Now you can run sql queries | |
\o out1.txt | Dump query results to out1.txt | |
\o | Stop dumping query results to file | |
\q | Log out of psql | |
Run 'logout' or press CTRL+D to log out of postgres user. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment