Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

pgroonga: Remove now-unnecessary 'GRANT USAGE' statement.

Alex Vandiverdc2726c81465
diff --git a/puppet/zulip/manifests/postgresql_base.pp b/puppet/zulip/manifests/postgresql_base.pp
index 98e07326ff8..12b78455dac 100644
--- a/puppet/zulip/manifests/postgresql_base.pp
+++ b/puppet/zulip/manifests/postgresql_base.pp
@@ -89,20 +89,10 @@ class zulip::postgresql_base {
}
$dbname = zulipconf('postgresql', 'database_name', 'zulip')
- $dbuser = zulipconf('postgresql', 'database_user', 'zulip')
- file { $pgroonga_setup_sql_path:
- ensure => file,
- require => Package["${postgresql}-pgdg-pgroonga"],
- owner => 'postgres',
- group => 'postgres',
- mode => '0640',
- content => template('zulip/postgresql/pgroonga_setup.sql.template.erb'),
- }
-
exec{'create_pgroonga_extension':
- require => File[$pgroonga_setup_sql_path],
+ require => Package["${postgresql}-pgdg-pgroonga"],
# lint:ignore:140chars
- command => "bash -c 'cat ${pgroonga_setup_sql_path} | su postgres -c \"psql -v ON_ERROR_STOP=1 ${dbname}\" && touch ${pgroonga_setup_sql_path}.applied'",
+ command => "bash -c 'echo \"CREATE EXTENSION PGROONGA\" | su postgres -c \"psql -v ON_ERROR_STOP=1 ${dbname}\" && touch ${pgroonga_setup_sql_path}.applied'",
# lint:endignore
creates => "${pgroonga_setup_sql_path}.applied",
}
diff --git a/puppet/zulip/templates/postgresql/pgroonga_setup.sql.template.erb b/puppet/zulip/templates/postgresql/pgroonga_setup.sql.template.erb
deleted file mode 100644
index 30308caa5a5..00000000000
--- a/puppet/zulip/templates/postgresql/pgroonga_setup.sql.template.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-CREATE EXTENSION PGROONGA;
-GRANT USAGE ON SCHEMA pgroonga TO <%= @dbuser %>;
diff --git a/scripts/setup/create-pgroonga.sql b/scripts/setup/create-pgroonga.sql
index 063ff7c711a..d1d9d29f4ef 100644
--- a/scripts/setup/create-pgroonga.sql
+++ b/scripts/setup/create-pgroonga.sql
@@ -1,3 +1,2 @@
\connect zulip
CREATE EXTENSION pgroonga;
-GRANT USAGE ON SCHEMA pgroonga TO zulip;
diff --git a/tools/setup/postgresql-init-dev-db b/tools/setup/postgresql-init-dev-db
index 0882e32d731..a27ec3a4a54 100755
--- a/tools/setup/postgresql-init-dev-db
+++ b/tools/setup/postgresql-init-dev-db
@@ -116,8 +116,6 @@ SELECT unnest(
ARRAY['ALTER SYSTEM SET pgroonga.enable_wal = ''on''', 'SELECT pg_reload_conf()']
END
) \gexec
-
-GRANT USAGE ON SCHEMA pgroonga TO $USERNAME;
EOF
psql -v ON_ERROR_STOP=1 -e -h localhost postgres "$USERNAME" <<EOF