Skip to content

Commit c447e67

Browse files
committedMay 9, 2015
postgres provider: ignore system columns
(cherry picked from commit aa377a0)
1 parent 54d5287 commit c447e67

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/providers/postgres/qgspostgresconn.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void QgsPostgresConn::addColumnInfo( QgsPostgresLayerProperty& layerProperty, co
321321
// TODO: optimize this query when pk candidates aren't needed
322322
// could use array_agg() and count()
323323
// array output would look like this: "{One,tWo}"
324-
QString sql = QString( "SELECT attname, CASE WHEN typname = ANY(ARRAY['geometry','geography','topogeometry']) THEN 1 ELSE null END AS isSpatial FROM pg_attribute JOIN pg_type ON atttypid=pg_type.oid WHERE attrelid=regclass('%1.%2')" )
324+
QString sql = QString( "SELECT attname, CASE WHEN typname = ANY(ARRAY['geometry','geography','topogeometry']) THEN 1 ELSE null END AS isSpatial FROM pg_attribute JOIN pg_type ON atttypid=pg_type.oid WHERE attrelid=regclass('%1.%2') AND attnum>0" )
325325
.arg( quotedIdentifier( schemaName ) )
326326
.arg( quotedIdentifier( viewName ) );
327327
//QgsDebugMsg( sql );

0 commit comments

Comments
 (0)
Please sign in to comment.