Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix #4832: also consider schema in geometry_columns/geography columns
  • Loading branch information
jef-n committed Jan 17, 2012
1 parent 9e71b01 commit db95089
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/providers/postgres/qgspostgresconn.cpp
Expand Up @@ -333,7 +333,12 @@ bool QgsPostgresConn::getTableInfo( bool searchGeometryColumnsOnly, bool searchP
" AND pg_namespace.oid=pg_class.relnamespace"
" AND has_schema_privilege(pg_namespace.nspname,'usage')"
" AND has_table_privilege('\"'||pg_namespace.nspname||'\".\"'||pg_class.relname||'\"','select')" // user has select privilege
" ORDER BY f_table_schema,f_table_name,%2" ).arg( gtableName ).arg( columnName );
).arg( gtableName ).arg( columnName );

if ( searchPublicOnly )
sql += " AND f_table_schema='public'";

sql += QString( " ORDER BY f_table_schema,f_table_name,%1" ).arg( columnName );

QgsDebugMsg( "getting table info: " + sql );
result = PQexec( sql, i == 0 );
Expand Down

0 comments on commit db95089

Please sign in to comment.