Files
zulip/scripts/setup/pgroonga-config
Alex Vandiver b2068222e0 pgroonga: Remove 'GRANT USAGE' statement again.
dc2726c814 removed these statements, but c8ec3dfcf6 accidentally
brought one back.  Remove it.

(cherry picked from commit f5540303ba)
2023-07-03 18:50:51 +00:00

21 lines
631 B
Bash
Executable File

#!/usr/bin/env bash
set -eux
dbversion=$(crudini --get /etc/zulip/zulip.conf postgresql version)
dbname=$(crudini --get /etc/zulip/zulip.conf postgresql database_name 2>/dev/null || echo zulip)
sharedir="${1:-/usr/share/postgresql/$dbversion}"
applied_file="$sharedir/pgroonga_setup.sql.applied"
installed_version=$(dpkg-query --show --showformat='${Version}' "postgresql-$dbversion-pgdg-pgroonga")
if [ ! -f "$applied_file" ]; then
sql="CREATE EXTENSION PGROONGA"
else
sql="ALTER EXTENSION pgroonga UPDATE"
fi
echo "$sql" | su postgres -c "psql -v ON_ERROR_STOP=1 $dbname"
echo "$installed_version" >"$applied_file"