mirror of
https://github.com/wassname/docker-postgresql.git
synced 2026-07-06 05:15:13 +08:00
Add unaccent extension
This commit is contained in:
committed by
Cédric Vanet
parent
638dd689bd
commit
9cca232ba0
@@ -14,6 +14,7 @@ PSQL_TRUST_LOCALNET=${PSQL_TRUST_LOCALNET:false}
|
||||
DB_NAME=${DB_NAME:-}
|
||||
DB_USER=${DB_USER:-}
|
||||
DB_PASS=${DB_PASS:-}
|
||||
DB_UNACCENT=${DB_UNACCENT:false}
|
||||
|
||||
# fix permissions and ownership of ${PG_HOME}
|
||||
mkdir -p -m 0700 ${PG_HOME}
|
||||
@@ -120,6 +121,13 @@ if [ -n "${DB_NAME}" ]; then
|
||||
sudo -u postgres -H ${PG_BINDIR}/postgres --single \
|
||||
-D ${PG_DATADIR} -c config_file=${PG_CONFDIR}/postgresql.conf >/dev/null
|
||||
|
||||
if [ "${DB_UNACCENT}" == "true" ]; then
|
||||
echo "Installing unaccent extension..."
|
||||
echo "CREATE EXTENSION IF NOT EXISTS unaccent;" | \
|
||||
sudo -u postgres -H ${PG_BINDIR}/postgres --single \
|
||||
-D ${PG_DATADIR} -c config_file=${PG_CONFDIR}/postgresql.conf >/dev/null
|
||||
fi
|
||||
|
||||
if [ -n "${DB_USER}" ]; then
|
||||
echo "Granting access to database \"${db}\" for user \"${DB_USER}\"..."
|
||||
echo "GRANT ALL PRIVILEGES ON DATABASE ${db} to ${DB_USER};" |
|
||||
|
||||
Reference in New Issue
Block a user