Skip to content

Instantly share code, notes, and snippets.

@paulghaddad
Last active August 29, 2015 14:13
Show Gist options
  • Save paulghaddad/20a8eb09d10a81887842 to your computer and use it in GitHub Desktop.
Save paulghaddad/20a8eb09d10a81887842 to your computer and use it in GitHub Desktop.
LevelUp 6: Can look up and use basic psql commands
1. Demonstrate the Rails command to enter the psql shell.
rails dbconsole
2. Demonstrate the command to get help on other psql commands.
psql --help for general help on psql.
From within psql, you can use \? to get the help on psql internal commands or \help for SQL commands.
3. Use that command to find out how to list all views, and then to view the query that generated a view.
- To list all views: \dv
- To view the query that generated a view: select view_definition from information_schema.views;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment