- Learn
- PostgreSQL
PostgreSQL
Tutorials and error guides with examples.
Quick Reference
- PostgreSQL Cheat Sheet— Complete syntax reference with interactive examples
Guides
- PostgreSQL default port— PostgreSQL's default port is 5432. Here's how to check it, change it, and connect.
- PostgreSQL default password— There is no default PostgreSQL password. Here's how to set one, reset it, and configure authentication.
- PostgreSQL COALESCE— COALESCE returns the first non-NULL value from a list. Use it to substitute defaults for NULL columns.
- PostgreSQL CREATE USER— Create PostgreSQL users with the right privileges and access controls.
- PostgreSQL list databases— List all PostgreSQL databases with \l in psql or query pg_database directly.
- PostgreSQL data types— PostgreSQL's data types and when to use each one.
- PostgreSQL UPDATE— Update single rows, multiple rows, and use RETURNING to get the changed data back.
- PostgreSQL CREATE DATABASE— Create PostgreSQL databases from the command line, psql, or SQL with the right options for your setup.
- PostgreSQL INSERT— Insert single rows, multiple rows, and handle conflicts with PostgreSQL's INSERT statement.
- PostgreSQL List Tables— All the ways to list tables in a PostgreSQL database.
- PostgreSQL CREATE TABLE— Everything you need to know about creating tables in PostgreSQL.
- PostgreSQL VACUUM: Maintenance and Optimization— Keep your PostgreSQL database healthy and fast.
- PostgreSQL List Users— View all users, roles, and permissions in PostgreSQL.
- PostgreSQL CREATE INDEX— Speed up your queries by teaching PostgreSQL where to look.
Errors
- duplicate key value violates unique constraint
- violates foreign key constraint
- null value in column violates not-null constraint
- new row violates check constraint
- relation does not exist
- column does not exist
- syntax error at or near
- password authentication failed
- database does not exist
- could not connect to server
- View all errors →