1. Which PostgreSQL feature stores semi-structured documents efficiently?
- BLOB-only tables
- CSV columns
- JSONB
- Spreadsheet links
Show answer
Answer: JSONB
JSONB is binary, indexable JSON.
Lesson: What PostgreSQL Is
25 questions from the PostgreSQL course, each with the correct answer and an explanation. Try to answer before you open the answer.
Answer: JSONB
JSONB is binary, indexable JSON.
Lesson: What PostgreSQL Is
Answer: \d table_name
Backslash commands are psql features.
Lesson: psql and Describing Tables
Answer: numeric
Money needs exact decimals.
Lesson: Choosing Data Types
Answer: FOREIGN KEY
Referential integrity.
Lesson: Constraints in Action
Answer: Returns columns from the rows affected by the statement
Get generated values without another round trip.
Lesson: Identity Columns and RETURNING
Answer: Excludes them, because the comparison is unknown
Use IS DISTINCT FROM for NULL-aware comparisons.
Lesson: NULL: Unknown, Not Empty
Answer: No
Specify the order you need.
Lesson: Filtering, Sorting and Limiting
Answer: LEFT JOIN from customers to orders
Left joins keep all left rows.
Lesson: Joins
Answer: In HAVING
HAVING works on aggregated groups.
Answer: A named intermediate result defined with WITH
Readable, composable queries.
Lesson: CTEs and Subqueries
Answer: They compute across rows while keeping every row in the result
Aggregates without collapsing.
Lesson: Window Functions
Answer: ->>
-> returns jsonb, ->> returns text.
Lesson: JSONB
Answer: The row that was proposed for insertion
Combine existing and proposed values.
Lesson: Upserts With ON CONFLICT
Answer: PostgreSQL reads every row of the table
Fine for small tables, costly for selective lookups on big ones.
Answer: It only includes rows matching its WHERE condition
Index only what queries need.
Lesson: Composite and Partial Indexes
Answer: GIN
Inverted indexes for element lookups.
Answer: It is aborted until you roll back (or roll back to a savepoint)
Errors must be handled explicitly.
Lesson: Transactions and Savepoints
Answer: Yes, each statement sees the latest committed data
Each statement gets a new snapshot.
Lesson: Isolation Levels
Answer: Locks the selected rows until the transaction ends
Serialise read-modify-write on a row.
Lesson: Row Locks and Lost Updates
Answer: Superuser privileges
Least privilege limits damage.
Lesson: Roles and Privileges
Answer: Table owners bypass RLS by default
Make sure policies actually apply.
Lesson: Row-Level Security
Answer: Regularly testing restores
A backup is only as good as its restore.
Lesson: Backup and Restore
Answer: Long-running or idle-in-transaction sessions
Old snapshots keep old row versions alive.
Lesson: MVCC, VACUUM and Monitoring
Answer: It builds the index without blocking writes to the table
Avoid long write locks.
Lesson: Safe Schema Migrations
Answer: Indexes are checked against real queries with EXPLAIN
Correct types, constraints and verified plans.
Lesson: A PostgreSQL Review Checklist