Skip to content

Add lesson 24: Arrays#83

Merged
exekias merged 1 commit into
mainfrom
lesson/24-arrays
Jul 2, 2026
Merged

Add lesson 24: Arrays#83
exekias merged 1 commit into
mainfrom
lesson/24-arrays

Conversation

@exekias

@exekias exekias commented Jul 2, 2026

Copy link
Copy Markdown
Member

Adds the second lesson of Module 6: Postgres power types — arrays (roadmap item 24-arrays).

What's in the lesson

  • Declaring array columns and both literal forms (ARRAY[...] vs '{a,b}')
  • 1-based indexing (out-of-bounds → NULL), slicing, array_length vs cardinality
  • unnest (in SELECT and FROM) and array_agg
  • Membership / set ops: = ANY, ALL, containment @>/<@, overlap &&
  • Mutation: array_append/array_prepend/array_remove/array_cat/||/array_position
  • Conversions: string_to_array/array_to_string, plus a GIN-index note (deferred to Module 7)

Seed

A 6-row articles(id, title, tags text[]) table with overlapping tags so containment/overlap/tag-cloud queries are interesting.

Checks

One query-returns check: array_append a tag to a row and verify the result.

Notes

Includes the byte-identical Module 6 module.yaml.

npm run lessons:validate and next build both pass.

Part of #6

🤖 Generated with Claude Code

Part of #6

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
learn-postgres Ready Ready Preview Jul 2, 2026 9:24am

@exekias exekias merged commit fb81bd5 into main Jul 2, 2026
3 checks passed
@exekias exekias deleted the lesson/24-arrays branch July 2, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant