Commit adc38124 authored by David Douard's avatar David Douard
Browse files

[server] fix deserialize_schema to handle properly pg schema (closes 17076486)

Postgres behaviour is to look first for a table in the configured schema then
fall back to 'public' if no table is found.

This must be implemented in deserialize_schema when listing existing tables
to check for computed relations (cw_cwcomputedrtype) otherwise computed
relations may not work when using non-default pg schema.

--HG--
branch : 3.25
parent e4ee04d442be
......@@ -92,6 +92,9 @@ def deserialize_schema(schema, cnx):
# Computed Rtype
tables = set(t.lower() for t in dbhelper.list_tables(cnx.cnxset.cu))
# on postgres, ensure the default schema name (public) is also checked
if dbhelper.backend_name == 'postgres':
tables.update(t.lower() for t in dbhelper.list_tables(cnx.cnxset.cu, 'public'))
has_computed_relations = 'cw_cwcomputedrtype' in tables
# computed attribute
try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment