Command Line PostgreSQL
In this lesson, you will learn about psql while creating a simple `bank_accounts` database. In addition to creating the database, you will become familiar with how to switch databases, create users, add permissions, and remove permissions to and from users. You will learn the concept of a superuser and what powers they have when using the database.
psql is similar to the sqlite3 command-line tool in that it allows you to connect to and manage databases. psql connects to a running PostgreSQL server process, then enables you to:
- Run queries.
- Manage users and permissions.
- Manage databases.
- See PostgreSQL system information.
The main advantage of using the psql shell is it gives us the ability to quickly test out queries and get results — transactions don't apply, so each command is quickly executed.
As you work through each concept, you’ll get to apply what you’ve learned from within your browser; there's no need to use your own machine to do the exercises. The Python environment inside of this course includes answer-checking to ensure you've fully mastered each concept before learning the next.
1. The psql tool
2. Running SQL queries
3. Special PostgreSQL commands
4. Switching databases
5. Creating users
6. Adding permissions
7. Removing permissions