summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axilleas@axilleas.me>2016-05-03 18:55:54 +0000
committerAchilleas Pipinellis <axilleas@axilleas.me>2016-05-03 18:55:54 +0000
commitd68c771ac6fc7b1d3bae58ca22f9720f0288d381 (patch)
tree6316771adb3f1ca4fd5072d695150f7f4329a40f
parenta0ea38c356889f8cca26ee389f6a466b03a6e057 (diff)
parent473e653e2408e818d0d61732332aeba53e5ca499 (diff)
downloadgitlab-ce-d68c771ac6fc7b1d3bae58ca22f9720f0288d381.tar.gz
Merge branch 'doc-installation-pg_trgm' into 'master'
Add clear instructions on installing the pg_trgm extension Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/17191 See merge request !4025
-rw-r--r--doc/install/installation.md56
1 files changed, 49 insertions, 7 deletions
diff --git a/doc/install/installation.md b/doc/install/installation.md
index e721e70a596..e3af3022262 100644
--- a/doc/install/installation.md
+++ b/doc/install/installation.md
@@ -157,22 +157,64 @@ Create a `git` user for GitLab:
## 5. Database
-We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](database_mysql.md). *Note*: because we need to make use of extensions you need at least pgsql 9.1.
+We recommend using a PostgreSQL database. For MySQL check the
+[MySQL setup guide](database_mysql.md).
- # Install the database packages
- sudo apt-get install -y postgresql postgresql-client libpq-dev
+> **Note**: because we need to make use of extensions you need at least pgsql 9.1.
- # Create a user for GitLab
+1. Install the database packages:
+
+ ```bash
+ sudo apt-get install -y postgresql postgresql-client libpq-dev postgresql-contrib
+ ```
+
+1. Create a database user for GitLab:
+
+ ```bash
sudo -u postgres psql -d template1 -c "CREATE USER git CREATEDB;"
+ ```
+
+1. Create the GitLab production database and grant all privileges on database:
- # Create the GitLab production database & grant all privileges on database
+ ```bash
sudo -u postgres psql -d template1 -c "CREATE DATABASE gitlabhq_production OWNER git;"
+ ```
+
+1. Create the `pg_trgm` extension (required for GitLab 8.6+):
+
+ ```bash
+ sudo -u postgres psql -d template1 -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;"
+ ```
+
+1. Try connecting to the new database with the new user:
- # Try connecting to the new database with the new user
+ ```bash
sudo -u git -H psql -d gitlabhq_production
+ ```
+
+1. Check if the `pg_trgm` extension is enabled:
+
+ ```bash
+ SELECT true AS enabled
+ FROM pg_available_extensions
+ WHERE name = 'pg_trgm'
+ AND installed_version IS NOT NULL;
+ ```
+
+ If the extension is enabled this will produce the following output:
- # Quit the database session
+ ```
+ enabled
+ ---------
+ t
+ (1 row)
+ ```
+
+1. Quit the database session:
+
+ ```bash
gitlabhq_production> \q
+ ```
## 6. Redis