summaryrefslogtreecommitdiff
path: root/odoo/tools/sql.py
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-09-04 18:12:00 +0200
committerChristophe Simonis <chs@odoo.com>2017-09-04 18:12:00 +0200
commit3ff4feafd24bdbe8121f16e2c6aaea901204b3a8 (patch)
tree7469ee4cfc69c3d27a273ff1dcd97cc7e2edf734 /odoo/tools/sql.py
parentc39ad11d443cb83891199a48e56af03e6fcdd786 (diff)
parent4d4d75709dcd46ffa957a68fa2f884ec59042718 (diff)
[MERGE] forward port branch saas-15 up to 4d4d75709dc
Diffstat (limited to 'odoo/tools/sql.py')
-rw-r--r--odoo/tools/sql.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/tools/sql.py b/odoo/tools/sql.py
index 563ed08c679..239cee73fd1 100644
--- a/odoo/tools/sql.py
+++ b/odoo/tools/sql.py
@@ -23,7 +23,7 @@ _CONFDELTYPES = {
def table_exists(cr, tablename):
""" Return whether the given table exists. """
- query = "SELECT 1 FROM information_schema.tables WHERE table_name=%s"
+ query = "SELECT 1 FROM pg_class WHERE relkind IN ('r', 'v', 'm') AND relname=%s"
cr.execute(query, (tablename,))
return cr.rowcount