Problem/Motivation

In #2846994: Increase minimum version requirement for Postgres to 10 and require the pg_trgm extension was the policy decision made that the pg_trgm extension was required. To use an extension on PostgreSQL, the extension must also be created. To be able to create an extension one must have superuser privileges.

Proposed resolution

Add the requirement for PostgreSQL that the pg_trgm extension is not only installed, but also created.

Remaining tasks

Make the policy decision and create an new CR.

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

PostgreSQL requires that the pg_trgm extension is installed and created.

Comments

daffie created an issue. See original summary.

daffie’s picture

daffie’s picture

Issue summary: View changes
catch’s picture

This seems like an oversight from the previous issue, not sure we need an explicit policy issue for this one - but untagging for release manger review. I think we could update the existing change record.

gábor hojtsy’s picture

This does indeed sound like an oversight. If its not created, it sounds like Drupal cannot use it, so its not really required. Do we need additional code checks or a policy fix only?

gábor hojtsy’s picture

Status: Active » Needs work
daffie’s picture

Status: Needs work » Needs review

The problem is that we cannot create the extension from Drupal. It must be done on the database by a superuser account. Which is hopefully not the account used by Drupal. We need add a hook_requirements() to test if the extension is created. My idea was to first get the policy change in and then do the patch. For the patch to work the testbot needs an update and for that @mixologic needs to policy change accepted. See: #3186676: Create the pg_trgm extension on PostgreSQL 10.12 and 12.1 database environments.

gábor hojtsy’s picture

#3186676: Create the pg_trgm extension on PostgreSQL 10.12 and 12.1 database environments is fixed. I think adding the hook_requirements() in Drupal 9 would be the next step. Do we expect that anyone will get bit by that? Maybe we add it as a warning in Drupal 9 and error in Drupal 10 if we think people will get problems by the sudden enforcement of our requirements?

daffie’s picture

Issue summary: View changes

I think adding the hook_requirements() in Drupal 9 would be the next step. Do we expect that anyone will get bit by that? Maybe we add it as a warning in Drupal 9 and error in Drupal 10 if we think people will get problems by the sudden enforcement of our requirements?

You had the same idea as me. The child 2 issues are created. See #3214921: Add a requirements warning in Drupal 9 when PostgreSQL is used and the pg_trgm extension is not created and #3214922: Add a requirements error in Drupal 10 when PostgreSQL is used and the pg_trgm extension is not installed or created.

@Gabor: Is there more that needs to be done for now for this issue?

gábor hojtsy’s picture

Status: Needs review » Fixed

No, it sounds like the policy is set. We have the implementation issues. Re-parented the implementation issues so they can be found in the proper lifecycle points. Closing this.

gábor hojtsy’s picture

andypost’s picture

Change record is not published for reason?

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

meyertox’s picture

What is the purpose of the pg_trgm extension in drupal9? Our database hoster does not support extensions, so the continuation of our drupal hosting ist threatened....

jweowu’s picture

meyertox: Refer to #2988018: [PP-1] Performance issues with path alias generated queries on PostgreSQL for the motivation behind these changes.

Adding pg_trgm will not be a requirement for any Drupal 9 release, but it will be required to use Postgres with Drupal 10.

m.stenta’s picture

I opened a follow-up to consider automatically installing pg_trgm in PostgreSQL 13+ databases, where it is considered a "trusted extension" and does not require superadmin privileges to install: #3349973: Automatically install pg_trgm extension on PostgreSQL 13+