Skip to content

Commit 75b6817

Browse files
author
g_j_m
committed
Reversion of change to the sql that worked out what view column depend on
which table columns - the recent commit didn't work when the database had more than one view, and in fact made things worse. Needs further work. git-svn-id: http://svn.osgeo.org/qgis/trunk@5959 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 6c5c204 commit 75b6817

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,7 +1346,7 @@ void QgsPostgresProvider::findColumns(tableCols& cols)
13461346
"SELECT DISTINCT "
13471347
" nv.nspname AS view_schema, "
13481348
" v.relname AS view_name, "
1349-
" va.attname AS view_column_name, "
1349+
" a.attname AS view_column_name, "
13501350
" nt.nspname AS table_schema, "
13511351
" t.relname AS table_name, "
13521352
" a.attname AS column_name, "
@@ -1360,7 +1360,6 @@ void QgsPostgresProvider::findColumns(tableCols& cols)
13601360
" pg_class t, "
13611361
" pg_namespace nt, "
13621362
" pg_attribute a,"
1363-
" pg_attribute va,"
13641363
" pg_user u, "
13651364
" pg_type typ "
13661365
"WHERE "
@@ -1380,9 +1379,7 @@ void QgsPostgresProvider::findColumns(tableCols& cols)
13801379
" t.oid = a.attrelid AND "
13811380
" dt.refobjsubid = a.attnum AND "
13821381
" nv.nspname NOT IN ('pg_catalog', 'information_schema' ) AND "
1383-
" a.atttypid = typ.oid AND "
1384-
" v.oid = va.attrelid AND "
1385-
" va.attnum = dt.refobjsubid";
1382+
" a.atttypid = typ.oid";
13861383

13871384
// A structure to store the results of the above sql.
13881385
typedef std::map<QString, TT> columnRelationsType;

0 commit comments

Comments
 (0)