Skip to content
Permalink
Browse files

Avoid having duplicated relations in the discovery

  • Loading branch information
Patrick Valsecchi authored and m-kuhn committed Nov 7, 2016
1 parent 0ca9eb0 commit 8e7ae8f04dedb0226e2ffd4fecab58a3ada6627c
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/providers/postgres/qgspostgresprovider.cpp
@@ -4007,6 +4007,7 @@ QList<QgsRelation> QgsPostgresProvider::discoverRelations( const QgsVectorLayer*
"ON KCU2.CONSTRAINT_CATALOG = RC.UNIQUE_CONSTRAINT_CATALOG AND KCU2.CONSTRAINT_SCHEMA = RC.UNIQUE_CONSTRAINT_SCHEMA AND KCU2.CONSTRAINT_NAME = RC.UNIQUE_CONSTRAINT_NAME "
"AND KCU2.ORDINAL_POSITION = KCU1.ORDINAL_POSITION "
"WHERE KCU1.CONSTRAINT_SCHEMA=" + QgsPostgresConn::quotedValue( mSchemaName ) + " AND KCU1.TABLE_NAME=" + QgsPostgresConn::quotedValue( mTableName ) +
"GROUP BY RC.CONSTRAINT_NAME, KCU1.COLUMN_NAME, KCU2.CONSTRAINT_SCHEMA, KCU2.TABLE_NAME, KCU2.COLUMN_NAME, KCU1.ORDINAL_POSITION " +
"ORDER BY KCU1.ORDINAL_POSITION"
);
QgsPostgresResult sqlResult( connectionRO()->PQexec( sql ) );

0 comments on commit 8e7ae8f

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