Changeset 334e7f9 in osmose-backend


Ignore:
Timestamp:
Sep 9, 2013 1:55:55 PM (6 years ago)
Author:
Jocelyn Jaubert <jocelyn.jaubert@…>
Branches:
master
Children:
df273b4
Parents:
f0dbecf
git-author:
Jocelyn Jaubert <jocelyn.jaubert@…> (09/09/2013 13:52:48)
git-committer:
Jocelyn Jaubert <jocelyn.jaubert@…> (09/09/2013 13:55:55)
Message:

Add support for views in addition to table for geometry_columns, as required by PostGIS 2.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osmose_run.py

    rf0dbecf r334e7f9  
    108108                            [table]) 
    109109            if giscurs.rowcount != 1: 
    110                 logger.log(log_av_r+u"missing table: "+table+log_ap) 
    111                 return False 
     110                # On PostGIS 2.0, geometry_columns has been moved to a view 
     111                giscurs.execute("""SELECT viewname FROM pg_views 
     112                                   WHERE viewname = %s""", 
     113                                [table]) 
     114                if giscurs.rowcount != 1: 
     115                    logger.log(log_av_r+u"missing table: "+table+log_ap) 
     116                    return False 
     117                else: 
     118                    # No need to check permissions for views 
     119                    continue 
    112120            for perm in ["select", "update", "delete"]: 
    113121                giscurs.execute("SELECT has_table_privilege(%s, %s)", 
Note: See TracChangeset for help on using the changeset viewer.