From dc2726c81465214910ffa7040ab509cd27cde173 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Fri, 23 Jun 2023 20:31:42 +0000 Subject: [PATCH] pgroonga: Remove now-unnecessary 'GRANT USAGE' statement. This was only necessary for PGroonga 1.x, and the `pgroonga` schema will most likely be removed at some point inthe future, which will make this statement error out. Drop the unnecessary statement. --- puppet/zulip/manifests/postgresql_base.pp | 14 ++------------ .../postgresql/pgroonga_setup.sql.template.erb | 2 -- scripts/setup/create-pgroonga.sql | 1 - tools/setup/postgresql-init-dev-db | 2 -- 4 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 puppet/zulip/templates/postgresql/pgroonga_setup.sql.template.erb diff --git a/puppet/zulip/manifests/postgresql_base.pp b/puppet/zulip/manifests/postgresql_base.pp index 98e07326ff..12b78455da 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 30308caa5a..0000000000 --- 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 063ff7c711..d1d9d29f4e 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 0882e32d73..a27ec3a4a5 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" <