Skip to content
Permalink
Browse files

postgres provider: ignore system columns

(cherry picked from commit aa377a0)
  • Loading branch information
jef-n committed May 9, 2015
1 parent 54d5287 commit c447e67eaef2bbaeb1b0ac67f539c7769b0fd79f
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/providers/postgres/qgspostgresconn.cpp
@@ -321,7 +321,7 @@ void QgsPostgresConn::addColumnInfo( QgsPostgresLayerProperty& layerProperty, co
// TODO: optimize this query when pk candidates aren't needed
// could use array_agg() and count()
// array output would look like this: "{One,tWo}"
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')" )
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" )
.arg( quotedIdentifier( schemaName ) )
.arg( quotedIdentifier( viewName ) );
//QgsDebugMsg( sql );

0 comments on commit c447e67

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