Skip to content

Commit 41de1a0

Browse files
Sandro Santillijef-n
Sandro Santilli
authored andcommittedNov 13, 2011
Add support for TopoGeometry datatype
(don't get too excited)
1 parent da698eb commit 41de1a0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎src/providers/postgres/qgspostgresprovider.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -876,8 +876,8 @@ bool QgsPostgresProvider::getTableInfo( bool searchGeometryColumnsOnly, bool sea
876876
"pg_namespace.oid=pg_class.relnamespace"
877877
" and pg_attribute.attrelid = pg_class.oid"
878878
" and ("
879-
" exists (select * from pg_type WHERE pg_type.oid=pg_attribute.atttypid AND pg_type.typname IN ('geometry','geography'))"
880-
" or pg_attribute.atttypid IN (select oid FROM pg_type a WHERE EXISTS (SELECT * FROM pg_type b WHERE a.typbasetype=b.oid AND b.typname IN ('geometry','geography')))"
879+
" exists (select * from pg_type WHERE pg_type.oid=pg_attribute.atttypid AND pg_type.typname IN ('geometry','geography','topogeometry'))"
880+
" or pg_attribute.atttypid IN (select oid FROM pg_type a WHERE EXISTS (SELECT * FROM pg_type b WHERE a.typbasetype=b.oid AND b.typname IN ('geometry','geography','topogeometry')))"
881881
")"
882882
" and has_schema_privilege( pg_namespace.nspname, 'usage' )"
883883
" and has_table_privilege( '\"' || pg_namespace.nspname || '\".\"' || pg_class.relname || '\"', 'select' )";
@@ -888,10 +888,13 @@ bool QgsPostgresProvider::getTableInfo( bool searchGeometryColumnsOnly, bool sea
888888

889889
if ( nColumns > 0 )
890890
{
891+
// TODO: handle this for the topogeometry case
891892
sql += " and not exists (select * from geometry_columns WHERE pg_namespace.nspname=f_table_schema AND pg_class.relname=f_table_name)";
892893

893894
if ( nGTables > 1 )
894895
{
896+
// TODO: handle this for the topogeometry case
897+
// TODO: handle this for the geometry case ?
895898
sql += " and not exists (select * from geography_columns WHERE pg_namespace.nspname=f_table_schema AND pg_class.relname=f_table_name)";
896899
}
897900
}

0 commit comments

Comments
 (0)
Please sign in to comment.