Learn PostgreSQL queries, psql, transactions, and logical backups.
PostgreSQL SQL and psql commands are separate from terminal commands. Use a disposable demo database and a provisioned demo user. Query examples assume a demo sites table (id, name, enabled) and checks table (id, site_id, result); schema-change examples use separate demo_sites fixtures.
19 entries · Essentials first · Reviewed October 5, 2026
Glossary: commands, keywords & terms
Select a term for its definition, syntax, example, and common mistakes.
Open a local demo database using the PostgreSQL interactive client.
Terminal
psql -U demo_user -d demo_db
Practical useConnect to an isolated application development database.
Common mistakesLocal socket authentication may use peer authentication rather than a password. Do not change server authentication rules just to run an example.
Practical useTest recovery of a disposable staging database.
Common mistakesUse compatible tool/server versions. Confirm the restore target; do not add --clean to a live database. Role and global-object backups are separate.