Search⌘ K

Inside PostgreSQL Extensions

Explore how PostgreSQL extensions expand the database capabilities by adding SQL objects like stored procedures, new data types, operators, and access methods. Understand the installation and inspection of extensions such as pg_trgm, and learn how these components integrate to improve query performance.

Extensions and SQL objects

Any SQL object can be part of an extension, and here’s a short list of common objects found in popular extensions:

  • Stored procedures
  • Data type
  • Operator, operator class, operator family
  • Index access method

Example: Installing the pg_trgm extension

As an example, we install the pg_trgm contrib extension and have a look at what it contains:

create extension pg_trgm;

Now the extension is enabled in our database, and it’s possible to list the object contained in the pg_trgm extension thanks to the psql command \dx+ pg_trgm. ...