How to set up PostgreSQL extensions on preview environments

Last updated: February 4, 2026

Set up PostgreSQL Extensions

To enable PostgreSQL extensions on your preview environments, follow these steps:

  1. Identify the extensions you need to install (such as uuid-ossp, pg_trgm, btree_gin, vector, plpgsql)

  2. Use the SQL command CREATE EXTENSION IF NOT EXISTS <extension-name> to install each extension

  3. Set up the extension installation as an initial job for your preview environment

  4. Configure the initial job to run automatically when the preview environment is created

  5. Test the setup by creating a new preview environment and verifying the extensions are available

Usage

Once configured as an initial job, the PostgreSQL extensions will be automatically installed every time a new preview environment is created. This ensures consistency across all your preview environments and eliminates the need to manually install extensions each time.