Skip to content
Opensource internals
  • Posts

Internals

PostgreSQL's text, varchar, and bpchar Implementation in C: One Type, Three Policies

Aug 10, 2026 8 min read Jay Hubbert

text, varchar(n) and char(n) are all the same varlena in C — the difference lives entirely in the input function, which truncates, checks, or blank-pads at write time.

PostgresInternalsTextVarcharBpchar

Read more →

PostgreSQL's Geometric Type Implementation in C: Seven Types, One 16-Byte Block

Aug 9, 2026 9 min read Jay Hubbert

point, line, lseg, box, path, polygon and circle are the same 16-byte Point assembled differently — with a dummy int4 for alignment and a cached bounding box inside polygons.

PostgresInternalsGeometricPointPolygon

Read more →

PostgreSQL Locks Tables Fast: The Fast Path and Sixteen Lock Partitions

Aug 6, 2026 36 min read Jay Hubbert

Most PostgreSQL locks never touch the heavyweight lock table: weak relation locks live in a per-backend fast path, and the real lock table is split into sixteen …

PostgresPerformanceConcurrencyInternals

Read more →

PostgreSQL's jsonpath Implementation in C: A Compiled Query Language

Aug 4, 2026 10 min read Jay Hubbert

jsonpath is a compiled value, not text: flex and bison parse it, a flatten pass links it with relative offsets, and you get back a normalized path instead of your input.

PostgresInternalsJsonpath

Read more →

PostgreSQL's json and jsonb Implementation in C: Text Versus Tree

Jul 28, 2026 9 min read Jay Hubbert

json keeps your exact bytes; jsonb re-serializes into a tree of 4-byte JEntry headers whose 28-bit field holds either a length or an offset.

PostgresInternalsJSONJsonb

Read more →

← Newer Page 6 of 7 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·