cubicweb/server/schemaserial.py
branch3.25
changeset 12194 2f9da7a8ecb6
parent 11774 51c160677afe
child 12542 85194bd49119
equal deleted inserted replaced
12193:e4ee04d442be 12194:2f9da7a8ecb6
    90     repo = cnx.repo
    90     repo = cnx.repo
    91     dbhelper = repo.system_source.dbhelper
    91     dbhelper = repo.system_source.dbhelper
    92 
    92 
    93     # Computed Rtype
    93     # Computed Rtype
    94     tables = set(t.lower() for t in dbhelper.list_tables(cnx.cnxset.cu))
    94     tables = set(t.lower() for t in dbhelper.list_tables(cnx.cnxset.cu))
       
    95     # on postgres, ensure the default schema name (public) is also checked
       
    96     if dbhelper.backend_name == 'postgres':
       
    97         tables.update(t.lower() for t in dbhelper.list_tables(cnx.cnxset.cu, 'public'))
    95     has_computed_relations = 'cw_cwcomputedrtype' in tables
    98     has_computed_relations = 'cw_cwcomputedrtype' in tables
    96     # computed attribute
    99     # computed attribute
    97     try:
   100     try:
    98         cnx.system_sql("SELECT cw_formula FROM cw_CWAttribute")
   101         cnx.system_sql("SELECT cw_formula FROM cw_CWAttribute")
    99         has_computed_attributes = True
   102         has_computed_attributes = True