From 5e259a8dd96d7054d65dff7368c4f599112df599 Mon Sep 17 00:00:00 2001 From: ToBeReplaced Date: Sat, 27 Jun 2015 11:41:01 -0600 Subject: [PATCH] Make ALL_IN_SCHEMA for tables affect views ALL TABLES is considered to include views, so we must check for reltypes 'r' and 'v', not just 'r'. This bug was introduced due to using a custom, backwards-compatible version of "ALL TABLES IN SCHEMA". --- lib/ansible/modules/database/postgresql/postgresql_privs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/database/postgresql/postgresql_privs.py b/lib/ansible/modules/database/postgresql/postgresql_privs.py index 10f2361bfb2..8fefd3de648 100644 --- a/lib/ansible/modules/database/postgresql/postgresql_privs.py +++ b/lib/ansible/modules/database/postgresql/postgresql_privs.py @@ -315,7 +315,7 @@ class Connection(object): query = """SELECT relname FROM pg_catalog.pg_class c JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace - WHERE nspname = %s AND relkind = 'r'""" + WHERE nspname = %s AND relkind in ('r', 'v')""" self.cursor.execute(query, (schema,)) return [t[0] for t in self.cursor.fetchall()]