Skip to content

Commit a7db7ff

Browse files
author
Sameer Naik
committed
added deprecation warning for DB_UNACCENT parameter
1 parent ec5ef8b commit a7db7ff

4 files changed

Lines changed: 9 additions & 18 deletions

File tree

README.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
- [Setting `postgres` user password](#setting-postgres-user-password)
1414
- [Creating database user](#creating-database-user)
1515
- [Creating databases](#creating-databases)
16-
- [Enabling unaccent extension](#enabling-unaccent-extension)
1716
- [Granting user access to a database](#granting-user-access-to-a-database)
1817
- [Enabling extensions](#enabling-extensions)
1918
- [Creating replication user](#creating-replication-user)
@@ -172,20 +171,6 @@ docker run --name postgresql -itd --restart always \
172171
sameersbn/postgresql:9.4-16
173172
```
174173

175-
# Enabling unaccent extension
176-
177-
Unaccent is a text search dictionary that removes accents (diacritic signs) from lexemes. It's a filtering dictionary, which means its output is always passed to the next dictionary (if any), unlike the normal behavior of dictionaries. This allows accent-insensitive processing for full text search [[source](http://www.postgresql.org/docs/9.4/static/unaccent.html)].
178-
179-
You can enable the unaccent extension on database(s) by specifying `DB_UNACCENT=true`. For example, the following command enables the unaccent extension for the `dbname` database.
180-
181-
```bash
182-
docker run --name postgresql -itd \
183-
--env 'DB_NAME=dbname' --env 'DB_UNACCENT=true' \
184-
sameersbn/postgresql:9.4-16
185-
```
186-
187-
*By default the unaccent extension is disabled*
188-
189174
## Granting user access to a database
190175

191176
If the `DB_USER` and `DB_PASS` variables are specified along with the `DB_NAME` variable, then the user specified in `DB_USER` will be granted access to all the databases listed in `DB_NAME`. Note that if the user and/or databases do not exist, they will be created.
@@ -211,6 +196,10 @@ docker run --name postgresql -itd \
211196

212197
The above command enables the `unaccent` and `pg_trgm` modules on the databases listed in `DB_NAME`, namely `db1` and `db2`.
213198

199+
> **NOTE**:
200+
>
201+
> This option deprecates the `DB_UNACCENT` parameter.
202+
214203
## Creating replication user
215204

216205
Similar to the creation of a database user, a new PostgreSQL replication user can be created by specifying the `REPLICATION_USER` and `REPLICATION_PASS` variables while starting the container.

docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ PostgreSQL:
1111
- DB_NAME=
1212
- DB_TEMPLATE=
1313

14-
- DB_UNACCENT=
1514
- DB_EXTENSION=
1615

1716
- REPLICATION_MODE=

runtime/env-defaults

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ DB_PASS=${DB_PASS:-}
1919
DB_TEMPLATE=${DB_TEMPLATE:-template1}
2020

2121
DB_EXTENSION=${DB_EXTENSION:-}
22-
23-
DB_UNACCENT=${DB_UNACCENT:-false}

runtime/functions

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,11 @@ load_extensions() {
309309
local database=${1?missing argument}
310310

311311
if [[ ${DB_UNACCENT} == true ]]; then
312+
echo
313+
echo "WARNING: "
314+
echo " The DB_UNACCENT option will be deprecated in favour of DB_EXTENSION soon."
315+
echo " Please migrate to using DB_EXTENSION"
316+
echo
312317
echo "‣ Loading unaccent extension..."
313318
psql -U ${PG_USER} -d ${database} -c "CREATE EXTENSION IF NOT EXISTS unaccent;" >/dev/null 2>&1
314319
fi

0 commit comments

Comments
 (0)