AI Hints
Home›PostgreSQL Tutorial›NOTIFY, Extensions and pgvector
PostgreSQL · Lesson 98 of 120

Extensions

Add-on powers.

⏱ 2 min read▶ Video at 1:28:26🎓 Free
Watch this lesson in the PostgreSQL courseWatch on YouTube ↗Full PostgreSQL course

Postgres can be extended with add ons. Some come built in, like pg trgm and pg stat statements. Others, like PostGIS for maps and pgvector for AI, are installed separately.

  • Built-in add-ons
  • Install more
  • CREATE EXTENSION

Available extensions

Pg available extensions lists what's installed on the server and can be turned on. We look at a few famous ones. Run it. Their versions, and whether they're enabled yet.

query.sqlsql
SELECT name, default_version, installed_version
FROM pg_available_extensions
WHERE name IN ('pg_trgm', 'pg_stat_statements', 'pgcrypto', 'vector')
ORDER BY name;
Output
        name        | default_version | installed_version
--------------------+-----------------+-------------------
 pg_stat_statements | 1.12            |
 pg_trgm            | 1.6             |
 pgcrypto           | 1.4             |
 vector             | 0.8.7           |
(4 rows)

Pg trgm adds fuzzy text search. Pgcrypto adds hashing and encryption. PostGIS adds maps and geography. Timescale adds time series features. And pgvector adds vectors for AI search.

ExtensionAdds
pg_trgmfuzzy text
pgcryptohashing, encryption
PostGISmaps, geography
TimescaleDBtime series
pgvectorAI vectors

Summary

Extensions add powerful features to Postgres with one command. Next, pgvector.

Key takeaways
  • CREATE EXTENSION
  • pg_trgm
  • pgvector
Next up: pgvector — vectors in Postgres