X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/a08c8d97d5cd3666799fb3bef14618d4c7c23398..45c0862be818c87ac9825ed36a7a2e9d3a1aab7c:/cookbooks/postgresql/resources/database.rb?ds=inline diff --git a/cookbooks/postgresql/resources/database.rb b/cookbooks/postgresql/resources/database.rb index 2d14cdfd1..cd2d4c764 100644 --- a/cookbooks/postgresql/resources/database.rb +++ b/cookbooks/postgresql/resources/database.rb @@ -43,7 +43,11 @@ end action :drop do if cluster.databases.include?(new_resource.database) converge_by "drop database #{new_resource.database}" do - cluster.execute(:command => "DROP DATABASE \"#{new_resource.database}\"") + if cluster.version >= 13 + cluster.execute(:command => "DROP DATABASE \"#{new_resource.database}\" WITH (FORCE)") + else + cluster.execute(:command => "DROP DATABASE \"#{new_resource.database}\"") + end end end end