Extensions for PostgreSQLs
Extensions are installable packages that add features to a PostgreSQL database with CREATE EXTENSION. Popular ones include PostGIS for geospatial data, pg_trgm for fuzzy text matching, pg_stat_statements for query statistics, and uuid-ossp or pgcrypto for identifiers and hashing. They are why one engine can cover many workloads.
Stage: Programming and Extensions · Part of the PostgreSQL roadmap · Last reviewed 19 November 2026
What to learn in Extensions
- Enable an extension in a database using CREATE EXTENSION
- Find the slowest queries with pg_stat_statements
- Speed up LIKE and fuzzy searches with pg_trgm indexes
- Run a distance query on geographic points using PostGIS
- Generate identifiers with UUID functions and check which extensions your host allows
Extensions interview questions
What does pg_stat_statements provide?
It tracks execution statistics for each normalised query, including calls, total and mean time and rows returned. Sorting by total time shows which queries use the most database resources and deserve indexes or rewrites.
How does pg_trgm help text search?
It breaks strings into three-character sequences and measures similarity between them. With a GIN or GiST trigram index, queries using LIKE, ILIKE or the similarity operator become fast and tolerate typos.
Where Extensions fits in the PostgreSQL roadmap
Extensions belongs to the Programming and Extensions stage (intermediate level). Extend the database.
Other units in this stage
Back to the full PostgreSQL roadmap