Skip to content

Commit

Permalink
fix data type check displaying PG table data
Browse files Browse the repository at this point in the history
  • Loading branch information
brushtyler committed Jul 15, 2012
1 parent 74c0122 commit 5131eb5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/plugins/db_manager/db_plugins/postgis/data_model.py
Expand Up @@ -50,9 +50,9 @@ def _createCursor(self):

def _sanitizeTableField(self, field):
# get fields, ignore geometry columns
if field.dataType.lower() == "geometry":
if QString(field.dataType).toLower() == "geometry":
return u"CASE WHEN %(fld)s IS NULL THEN NULL ELSE GeometryType(%(fld)s) END AS %(fld)s" % {'fld': self.db.quoteId(field.name)}
elif field.dataType.lower() == "raster":
elif QString(field.dataType).toLower() == "raster":
return u"CASE WHEN %(fld)s IS NULL THEN NULL ELSE 'RASTER' END AS %(fld)s" % {'fld': self.db.quoteId(field.name)}
return u"%s::text" % self.db.quoteId(field.name)

Expand Down

0 comments on commit 5131eb5

Please sign in to comment.