Problem/Motivation
#3104007: Postgresql 12 DrupalCI environment needed for core testing added/installed the pg_trgm extension on PostgreSQL 10 and 12. The next step is to create the extension in the database, only the database user has to have superuser privileges. The testbot database user does not have those privileges, therefore the extension must be created in the drupalci_environment. This is needed to make the solution for #2988018: [PP-1] Performance issues with path alias generated queries on PostgreSQL testable.
Proposed resolution
Created the pg_trgm extension in the database.
Remaining tasks
- Manual testing/Review
Manual testing
Setup inside a drupalci vagrant VM
TODO: Point to the documentation for what a drupalci vagrant VM is, and how to install it
(Do NOT perform the following tests in your host environment, as they will delete all of your pre-existing docker containers.)
- Clone drupalci_environments
- Apply the patch inside of it
- cd ~/drupalci_environments/db/pgsql-10.12
- docker build . (if successful, this will return a line like "Successfully built 7d7cfc3ec4ac")
- docker tag 7d7cfc3ec4ac drupalci/pgsql-10.12 (7d7cfc3ec4ac comes from the previous line)
- Do the same for PostgreSQL 12.1
Manually Test schema and extension output
for IMAGE in 10.12 12.1 ; do
docker run -d drupalci/pgsql-${IMAGE} ;
sleep 20;
docker exec -ti $(docker ps -q) psql -d drupaltestbot -c "SELECT * FROM pg_available_extensions WHERE name = 'pg_trgm'" ;
docker rm -f $(docker ps -q) ;
done
The output for those exec commands should look like this given 10.12 and 12.1
name | default_version | installed_version | comment
---------+-----------------+-------------------+-------------------------------------------------------------------
pg_trgm | 1.3 | 1.3 | text similarity measurement and index searching based on trigrams
(1 row)
Release notes snippet
DrupalCI now has the pg_tgrm extension created on the PostgreSQL versions 10 and 12 database environments .
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3186676-2.patch | 1.59 KB | daffie |
Issue fork drupalci_environments-3186676
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
daffie commentedAdded the patch.
Comment #3
daffie commentedComment #4
daffie commentedAccording to the PostgreSQL manual:
See: https://www.postgresql.org/docs/10/sql-createextension.html
Comment #5
jweowu commentedThe test script given worked for me, with one hiccup -- the first time through I got the following failure:
I'm guessing that whatever that
sleep 20is for simply needed more time, as additional runs were successful:Comment #6
jweowu commentedComment #7
daffie commentedGot the ok from @catch for the policy change. See: #3190516-5: [Policy] For PostgreSQL require that the pg_trgm extension is not only installed, but also created..
@jweowu: Thank you for the review. Do you think that the patch is RTBC?
Comment #10
daffie commented@mixologic Thank you for committing the patch.
Comment #11
daffie commentedComment #12
daffie commented