]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/postgresql/libraries/postgresql.rb
Limit postgresql_table to acting on tables
[chef.git] / cookbooks / postgresql / libraries / postgresql.rb
index 62188795bd3f3aa6d168e5b172bdae217533f250..4f0d4a1fe5166d4699c1fd885bda6ff17e0a1f06 100644 (file)
@@ -112,7 +112,7 @@ module OpenStreetMap
 
     def tables(database)
       @tables ||= {}
-      @tables[database] ||= query("SELECT n.nspname, c.relname, u.usename, c.relacl FROM pg_class AS c INNER JOIN pg_user AS u ON c.relowner = u.usesysid INNER JOIN pg_namespace AS n ON c.relnamespace = n.oid", :database => database).each_with_object({}) do |table, tables|
+      @tables[database] ||= query("SELECT n.nspname, c.relname, u.usename, c.relacl FROM pg_class AS c INNER JOIN pg_user AS u ON c.relowner = u.usesysid INNER JOIN pg_namespace AS n ON c.relnamespace = n.oid WHERE c.relkind = 'r'", :database => database).each_with_object({}) do |table, tables|
         name = "#{table[:nspname]}.#{table[:relname]}"
 
         tables[name] = {