]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/postgresql/resources/database.rb
nominatim: ruby packages needed for prometheus
[chef.git] / cookbooks / postgresql / resources / database.rb
index 2d14cdfd15421847b0d9767a9ce728c76e4a6e9d..cd2d4c7644f27f9bcac74ac326ab64dbcd2a8730 100644 (file)
@@ -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