Skip to content

Commit 370383e

Browse files
committed
postgresql_table: Fix multiple schema handling (#817)
1 parent 1317e05 commit 370383e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugins/modules/postgresql_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ def __exists_in_db(self):
300300
query = ("SELECT t.tableowner, t.tablespace, c.reloptions "
301301
"FROM pg_tables AS t "
302302
"INNER JOIN pg_class AS c ON c.relname = t.tablename "
303-
"INNER JOIN pg_namespace AS n ON c.relnamespace = n.oid "
303+
"INNER JOIN pg_namespace AS n ON t.schemaname = n.nspname AND c.relnamespace = n.oid "
304304
"WHERE t.tablename = %(tblname)s "
305305
"AND n.nspname = %(schema)s")
306306
res = exec_sql(self, query, query_params={'tblname': tblname, 'schema': schema},

0 commit comments

Comments
 (0)