Automatically install pg_trgm extension on PostgreSQL 13+

Created on 23 March 2023, almost 2 years ago
Updated 22 June 2023, over 1 year ago

Problem/Motivation

Drupal 10+ added a requirement on the pg_trgm extension when installed in PostgreSQL environments. See 📌 [Policy] For PostgreSQL require that the pg_trgm extension is not only installed, but also created. Fixed .

This means that site admins need to take an additional manual step between setting up their database and installing Drupal, by running this query on their database:

CREATE EXTENSION pg_trgm;

In PostgreSQL 12, this must be done by a database user with superadmin privileges.

In PostgreSQL 13+, however, the pg_trgm extension has been designated as a "trusted extension" (a new concept added in 13: https://www.postgresql.org/docs/13/release-13.html#id-1.11.6.15.5.14), which means that it should be possible for Drupal to run the necessary query itself (using the less-privileged Drupal database user) during installation on a PostgreSQL 13+ database.

Proposed resolution

I propose we add some logic to Drupal's PostgreSQL database installation tasks that install the pg_trgm extension automatically if the PostgreSQL version is 13+.

Remaining tasks

TBD.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

TBD.

✨ Feature request
Status

Fixed

Version

11.0 🔥

Component
PostgreSQL driver  →

Last updated 12 days ago

No maintainer
Created by

🇺🇸United States m.stenta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024