- Describe Postgres
- Use psql in the terminal
- Create a db
- Create a table
- Insert values
- Query the table to see values
Both PostgreSQL and
Postgres are correct spellings
Pronounced Post-Gres-Q-L or Post-Gres
Incorrect spellings are PostGres, PostGreSQL, PostgresQL, et al.
Open source object-relational
database system
RDBMS: Relational database management system
Fully ACID compliant (Atomicity, Consistency, Isolation, Durability)
You!
Everyone!
The development of Postgres is completely driven by open source and the community
Atomicity: Each transaction is "all or nothing"
Consistency: Any transaction will bring the database from one valid state to another.
Isolation: The concurrent execution of transactions results in a system state that would be obtained if transactions were executed serially, i.e., one after the other.
Durability: Once a transaction has been committed, it will remain so, even in the event of power loss, crashes, or errors.
postgres: The database itself
psql: PostgreSQL interactive terminal
Client Applications (Etc.)
Driver: such as pg
ORM: Such as Sequelize, Massive, bookshelf, knex
Here you can do all sort of things:
Need help on a command? Use: \h
ctrl+d or \q
to quit
q to quit
q to quit
NOTE THE CHANGE IN CAPS
While in psql
From the terminal
NOTE THE CHANGE IN PROMPT
create table
view tables
view columns
\h - Get help
\c - Connect to a database
\l - List all databases you can see in Postgres
\dt - Describe all tables in the current database
\d [tablename] - Describe the columns of a table
\q - Quit
- Describe Postgres
- Use psql in the terminal
- Create a db
- Create a table
- Insert values
- Query the table to see values
Create a database called 'psqlPractice'
Create tables: 'food', 'book', 'movie'
(each with an id, name, and entry)
Insert values for each peer sitting at your pod
Do a select statement to see all the data.