Skip to content
Browse docs

PostgreSQL extensions

PostgreSQL databases on Layerbase Cloud have an Extensions tab on their page once the database's server supports it. It lists the extensions Layerbase supports, shows which are enabled in this database and at what version, and lets the database owner turn them on or off. Anyone with access to the database can see the list.

If the server does not offer extensions yet, the page hides the Extensions tab. Until it appears, the switch that turns pg_cron on or off stays in the Scheduled jobs tab.

What is available

The standard contrib extensions ship with every PostgreSQL database:

  • pg_trgm: Trigram similarity search and fast LIKE.
  • pgcrypto: Hashing, encryption and random bytes.
  • uuid-ossp: Functions that generate UUIDs.
  • hstore: Key and value pairs in a single column.
  • citext: Case-insensitive text.
  • ltree: Tree paths, such as categories.
  • tablefunc: Crosstab and other table functions.
  • unaccent: Strips accents for text search.
  • postgres_fdw: Query tables on another PostgreSQL.

The tab also lists pg_cron, which runs SQL on a schedule inside the database (see Scheduled jobs). pg_cron needs a supported PostgreSQL version. When the database's version or build lacks an extension, the tab shows Not on this version with the reason instead of an Enable button.

PostGIS and pgvector are not available yet. Neither is pg_stat_statements: it needs a preload we plan to add. For vector search, Qdrant and Weaviate run on the same account and plan.

Turn an extension on or off in the tab

  1. Open the database's page and choose the Extensions tab.
  2. Click Enable next to the extension, or Disable when it is enabled.
  3. Enabling most extensions takes effect at once. Disabling asks you to confirm first.

Only the database owner can turn extensions on or off. Team members see the same buttons grayed out with the reason, and can still use SQL as described below.

Disabling never cascades. If tables, columns, indexes or functions in the database still depend on the extension, nothing is removed and the tab shows the PostgreSQL error that names what blocks it. Drop or change those objects first, then try again.

pg_cron restarts the database

pg_cron has to be loaded when PostgreSQL starts, so turning it on or off restarts the database once. It is unavailable for a short time, and open connections drop and reconnect. The confirm dialog asks you to check I understand the database restarts and open connections drop before Restart and turn on or Restart and turn off. Turning pg_cron off keeps your jobs and their run history; turning it back on brings back the same jobs. Jobs run only while the database is awake. Create and manage jobs in the Scheduled jobs tab.

Sleeping databases

Opening the tab never wakes the database. While it sleeps, the tab shows the list of extensions its version offers, with the status Unknown, and a Wake to see live status button. Waking is a step you take yourself; once the database is awake, the tab shows which extensions are enabled and the Enable and Disable buttons work.

Use SQL instead

The contrib extensions are one statement away from any SQL client or the query console, for the owner and team members alike:

CREATE EXTENSION IF NOT EXISTS pg_trgm;
DROP EXTENSION pg_trgm;

Refresh the tab to see a change made with SQL. pg_cron needs more than CREATE EXTENSION, because it must be preloaded; the pg_cron section of Database lifecycle walks through the SQL opt-in.