Skip to content
Permalink
Browse files

fix data type check displaying PG table data

  • Loading branch information
brushtyler committed Jul 15, 2012
1 parent 74c0122 commit 5131eb5d87342746d6ceb76714cabae58aa592ff
Showing with 2 additions and 2 deletions.
  1. +2 −2 python/plugins/db_manager/db_plugins/postgis/data_model.py
@@ -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)

0 comments on commit 5131eb5

Please sign in to comment.
You can’t perform that action at this time.