# Editorial Corrections

> Corrections to the pinned English source edition, with PostgreSQL references.

---

LLMS index: [llms.txt](/en/llms.txt)

---

This web edition corrects technical errors in the pinned source, and marks the
adaptation in each page's attribution. The original repository and its license
remain available from [Publication and License](/en/publication/).

Chapter order is unchanged. The three comma-containing titles are recovered
from their chapter headings, and OINK provides the sequential chapter navigation.

Displayed SQL and downloadable SQL use the same corrected example. Chapters 54
and 56 instead pair a shell example or command reference with a SQL companion.

Console output is illustrative: dates, UUIDs, users, catalog listings, statistics,
and query plans depend on the environment. Ellipses mark omitted output.

## 1. First Query {#chapter-1}

[Read the corrected lesson](/en/01-first-query/).

The client/server version explanation now distinguishes the version reported by the connected server from the local psql binary.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/app-psql.html).

## 2. psql Basics {#chapter-2}

[Read the corrected lesson](/en/02-psql-basics/).

The psql section now explains that -f processes backslash commands and that these commands are client syntax which may issue catalog queries.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/app-psql.html).

## 3. SELECT Basics {#chapter-3}

[Read the corrected lesson](/en/03-select-basics/).

The SELECT wording no longer promises an evaluation order that SQL does not guarantee.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-select.html).

## 4. WHERE {#chapter-4}

[Read the corrected lesson](/en/04-where/).

The runnable series query is fixed, and the ILIKE and NULL predicate guidance now reflects PostgreSQL's actual planner and three-valued-logic behavior.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-select.html), [reference 2](https://www.postgresql.org/docs/17/indexes-types.html), [reference 3](https://www.postgresql.org/docs/17/functions-comparison.html).

## 7. LIMIT and OFFSET {#chapter-7}

[Read the corrected lesson](/en/07-limit-offset/).

The OFFSET cost example now describes the number of rows processed without an off-by-one claim.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-select.html).

## 8. DISTINCT {#chapter-8}

[Read the corrected lesson](/en/08-distinct/).

The DISTINCT example now correctly explains that parentheses around a selected expression do not change the distinct key.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-select.html).

## 9. NULLs {#chapter-9}

[Read the corrected lesson](/en/09-nulls/).

The NULL comparison explanation now separates unknown comparisons, DISTINCT grouping, and IS DISTINCT FROM.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/functions-comparison.html).

## 10. Expressions {#chapter-10}

[Read the corrected lesson](/en/10-expressions/).

The cast example uses an unambiguous output name.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/datatype-numeric.html).

## 11. Numeric Types {#chapter-11}

[Read the corrected lesson](/en/11-numeric-types/).

Numeric ranges, overflow behavior, and unconstrained numeric limits are stated more precisely.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/datatype-numeric.html).

## 12. Text Types {#chapter-12}

[Read the corrected lesson](/en/12-text-types/).

The character padding example now distinguishes character length from stored byte length and labels the collation example accurately.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/functions-string.html).

## 13. Boolean and Dates {#chapter-13}

[Read the corrected lesson](/en/13-boolean-and-dates/).

The date/time section now describes timestamptz display semantics and current_timestamp versus clock_timestamp correctly.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/functions-datetime.html).

## 14. UUID and JSONB {#chapter-14}

[Read the corrected lesson](/en/14-uuid-jsonb/).

UUIDv7 availability is version-scoped: PostgreSQL 17 has no built-in generator, while PostgreSQL 18 provides uuidv7().

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/18/functions-uuid.html).

## 15. Arrays and ENUM {#chapter-15}

[Read the corrected lesson](/en/15-arrays-and-enum/).

The array indexing text acknowledges PostgreSQL's default lower bound without overstating the rule.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/arrays.html).

## 17. Column Types and Constraints {#chapter-17}

[Read the corrected lesson](/en/17-column-types-and-constraints/).

Constraint placement is described accurately for composite constraints and multi-column CHECK expressions.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-createtable.html).

## 18. ALTER TABLE and DROP {#chapter-18}

[Read the corrected lesson](/en/18-alter-table-and-drop/).

ALTER TABLE guidance now distinguishes changes that require a table rewrite from binary-compatible changes and describes rename dependencies more carefully.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-altertable.html).

## 19. Primary Keys and UNIQUE {#chapter-19}

[Read the corrected lesson](/en/19-primary-keys-and-unique/).

The NULLS NOT DISTINCT recommendation no longer presents a partial unique index as an equivalent solution.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/ddl-constraints.html), [reference 2](https://www.postgresql.org/docs/17/sql-createtable.html).

## 21. NOT NULL and DEFAULT {#chapter-21}

[Read the corrected lesson](/en/21-not-null-and-default/).

The table-default discussion distinguishes nonvolatile current_timestamp from volatile defaults such as random().

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-altertable.html), [reference 2](https://www.postgresql.org/docs/17/sql-update.html).

## 22. Identity Columns and Sequences {#chapter-22}

[Read the corrected lesson](/en/22-identity-and-sequences/).

Sequence objects are shared across sessions; currval() state is the session-local part.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/functions-sequence.html).

## 23. Schemas and search_path {#chapter-23}

[Read the corrected lesson](/en/23-schemas/).

SECURITY DEFINER and search_path guidance now uses a trusted path with pg_temp last, and schema drops are described as transactionally reversible before commit.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-createfunction.html), [reference 2](https://www.postgresql.org/docs/17/ddl-schemas.html).

## 25. UPSERT (ON CONFLICT) {#chapter-25}

[Read the corrected lesson](/en/25-upsert/).

The ON CONFLICT examples now use the actual constraint name and qualify the partial-index caveat.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-insert.html).

## 26. UPDATE {#chapter-26}

[Read the corrected lesson](/en/26-update/).

The update lesson now uses IS DISTINCT FROM for a NULL-safe change test.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-update.html).

## 27. DELETE {#chapter-27}

[Read the corrected lesson](/en/27-delete/).

DELETE and TRUNCATE behavior now distinguishes row-level triggers, foreign-key checks, locking, WAL, and rollback semantics.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-truncate.html), [reference 2](https://www.postgresql.org/docs/17/sql-delete.html), [reference 3](https://www.postgresql.org/docs/17/sql-select.html).

## 28. RETURNING {#chapter-28}

[Read the corrected lesson](/en/28-returning/).

RETURNING syntax is scoped to PostgreSQL 17, with the PostgreSQL 18 old/new extension identified separately.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/18/dml-returning.html), [reference 2](https://www.postgresql.org/docs/17/sql-createtable.html).

## 29. INNER and LEFT JOIN {#chapter-29}

[Read the corrected lesson](/en/29-inner-and-left-join/).

The join warning no longer says PostgreSQL warns about valid cross joins or treats a missing INNER JOIN condition as valid syntax.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-select.html).

## 32. UNION, INTERSECT, EXCEPT {#chapter-32}

[Read the corrected lesson](/en/32-union-intersect-except/).

The ALL variants of UNION, INTERSECT, and EXCEPT are described with their different duplicate rules.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-select.html).

## 33. COUNT, SUM, AVG {#chapter-33}

[Read the corrected lesson](/en/33-count-sum-avg/).

Aggregate NULL behavior is no longer generalized to aggregates such as array_agg and jsonb_agg that retain NULL inputs.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/functions-aggregate.html).

## 35. HAVING {#chapter-35}

[Read the corrected lesson](/en/35-having/).

The WHERE/HAVING performance guidance now leaves room for PostgreSQL to push suitable predicates down.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-select.html).

## 36. Scalar and IN Subqueries {#chapter-36}

[Read the corrected lesson](/en/36-scalar-and-in-subqueries/).

A scalar subquery is correctly described as returning at most one row, with zero rows producing NULL.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-select.html), [reference 2](https://www.postgresql.org/docs/17/functions-comparison.html).

## 37. EXISTS and Derived Tables {#chapter-37}

[Read the corrected lesson](/en/37-exists-and-derived-tables/).

Derived-table alias guidance reflects PostgreSQL 16's optional alias behavior while retaining the portability recommendation.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-select.html).

## 38. Common Table Expressions (WITH) {#chapter-38}

[Read the corrected lesson](/en/38-cte/).

CTE folding, recursive UNION choices, nontermination, and data-modifying CTE ordering are described without unsupported guarantees.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/queries-with.html).

## 39. Window Functions {#chapter-39}

[Read the corrected lesson](/en/39-window-functions/).

Window-frame defaults and the need for an explicit lag/lead order are stated precisely.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/functions-window.html), [reference 2](https://www.postgresql.org/docs/17/sql-select.html).

## 40. String and Numeric Functions {#chapter-40}

[Read the corrected lesson](/en/40-string-and-numeric-functions/).

The examples distinguish random integer generation from a direct floating-point cast and correct the rounding description.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/functions-math.html).

## 41. Date Functions and COALESCE {#chapter-41}

[Read the corrected lesson](/en/41-date-functions-and-coalesce/).

Date bucketing and extract(epoch) are aligned with PostgreSQL 17's return types and date functions.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/functions-datetime.html).

## 42. CASE {#chapter-42}

[Read the corrected lesson](/en/42-case/).

FILTER is compared with CASE without claiming identical empty-result behavior.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/functions-aggregate.html).

## 43. CREATE INDEX {#chapter-43}

[Read the corrected lesson](/en/43-create-index/).

Multicolumn index guidance reflects modern planner options, lock modes, and HOT-update behavior.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/indexes-multicolumn.html), [reference 2](https://www.postgresql.org/docs/17/explicit-locking.html), [reference 3](https://www.postgresql.org/docs/17/indexes-types.html).

## 44. When to Index {#chapter-44}

[Read the corrected lesson](/en/44-when-to-index/).

The index-selection guidance removes a universal selectivity percentage and an overbroad redundancy rule.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/indexes-types.html), [reference 2](https://www.postgresql.org/docs/17/indexes-multicolumn.html), [reference 3](https://www.postgresql.org/docs/17/sql-select.html).

## 45. EXPLAIN and Query Plans {#chapter-45}

[Read the corrected lesson](/en/45-explain/).

The EXPLAIN aggregate counts actual child rows, and index-only scans now mention visibility-map heap checks.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/using-explain.html), [reference 2](https://www.postgresql.org/docs/17/indexes-index-only-scans.html).

## 46. BEGIN, COMMIT, ROLLBACK {#chapter-46}

[Read the corrected lesson](/en/46-begin-commit-rollback/).

Transaction durability and dry-run limitations now mention normal durability settings, sequence increments, locks, and external effects; the two-session exercise recreates its demo table first.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/wal-async-commit.html), [reference 2](https://www.postgresql.org/docs/17/functions-sequence.html), [reference 3](https://www.postgresql.org/docs/17/sql-createtable.html).

## 48. CREATE VIEW {#chapter-48}

[Read the corrected lesson](/en/48-create-view/).

CREATE OR REPLACE VIEW restrictions are separated from ALTER VIEW column renames.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-createview.html).

## 49. Materialized Views {#chapter-49}

[Read the corrected lesson](/en/49-materialized-views/).

REFRESH MATERIALIZED VIEW CONCURRENTLY is described as a full-query refresh requiring a populated matview and a suitable unique index.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-refreshmaterializedview.html), [reference 2](https://www.postgresql.org/docs/17/sql-select.html).

## 50. Functions and PL/pgSQL {#chapter-50}

[Read the corrected lesson](/en/50-functions-and-plpgsql/).

Function volatility, SECURITY DEFINER search paths, and PL/pgSQL statement syntax are corrected.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-createfunction.html), [reference 2](https://www.postgresql.org/docs/17/plpgsql-structure.html).

## 51. Triggers {#chapter-51}

[Read the corrected lesson](/en/51-triggers/).

Trigger return values now distinguish INSERT/UPDATE from DELETE, and the exercise accounts for the script's cleanup.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/plpgsql-trigger.html).

## 52. Full-Text Search {#chapter-52}

[Read the corrected lesson](/en/52-full-text-search/).

The full-text-search exercise tells readers to run it before the script drops its demonstration table.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-createtable.html), [reference 2](https://www.postgresql.org/docs/17/sql-select.html).

## 53. VACUUM and ANALYZE {#chapter-53}

[Read the corrected lesson](/en/53-vacuum-and-analyze/).

VACUUM's visibility-map role, tail-page truncation, and autovacuum guidance are more exact.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/routine-vacuuming.html).

## 54. pg_dump and pg_restore {#chapter-54}

[Read the corrected lesson](/en/54-pg-dump-and-restore/).

pg_dump snapshot, globals, version compatibility, and restore behavior are corrected and qualified.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/app-pgdump.html), [reference 2](https://www.postgresql.org/docs/17/app-pg-dumpall.html).

## 55. Roles and GRANT {#chapter-55}

[Read the corrected lesson](/en/55-roles-and-grant/).

The role and RLS example now forces row security for the table owner and documents the limits of a freely changeable tenant setting.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-createrole.html), [reference 2](https://www.postgresql.org/docs/17/ddl-rowsecurity.html), [reference 3](https://www.postgresql.org/docs/17/ddl-priv.html), [reference 4](https://www.postgresql.org/docs/17/sql-alterdefaultprivileges.html).

## 56. psql Meta-commands {#chapter-56}

[Read the corrected lesson](/en/56-psql-meta-commands/).

The psql command reference now accurately covers files executed with -f, SQL alternatives, and CSV output mode.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/app-psql.html).

## 57. COPY {#chapter-57}

[Read the corrected lesson](/en/57-copy/).

COPY FROM trigger behavior, encoding selection, bulk-load performance, and the executable multiline \copy exercise are corrected.

PostgreSQL documentation: [reference 1](https://www.postgresql.org/docs/17/sql-copy.html), [reference 2](https://www.postgresql.org/docs/17/app-psql.html).
