summaryrefslogtreecommitdiff
path: root/odoo/tools/sql.py
diff options
context:
space:
mode:
Diffstat (limited to 'odoo/tools/sql.py')
-rw-r--r--odoo/tools/sql.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/odoo/tools/sql.py b/odoo/tools/sql.py
index 6c783fe27e7..75f71b2e6b4 100644
--- a/odoo/tools/sql.py
+++ b/odoo/tools/sql.py
@@ -53,7 +53,11 @@ def table_columns(cr, tablename):
""" Return a dict mapping column names to their configuration. The latter is
a dict with the data from the table ``information_schema.columns``.
"""
- query = 'SELECT * FROM information_schema.columns WHERE table_name=%s'
+ # Do not select the field `character_octet_length` from `information_schema.columns`
+ # because specific access right restriction in the context of shared hosting (Heroku, OVH, ...)
+ # might prevent a postgres user to read this field.
+ query = '''SELECT column_name, udt_name, character_maximum_length, is_nullable
+ FROM information_schema.columns WHERE table_name=%s'''
cr.execute(query, (tablename,))
return {row['column_name']: row for row in cr.dictfetchall()}