Skip to content

Commit 8e7ae8f

Browse files
Patrick Valsecchim-kuhn
Patrick Valsecchi
authored andcommittedNov 7, 2016
Avoid having duplicated relations in the discovery
1 parent 0ca9eb0 commit 8e7ae8f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
 

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4007,6 +4007,7 @@ QList<QgsRelation> QgsPostgresProvider::discoverRelations( const QgsVectorLayer*
40074007
"ON KCU2.CONSTRAINT_CATALOG = RC.UNIQUE_CONSTRAINT_CATALOG AND KCU2.CONSTRAINT_SCHEMA = RC.UNIQUE_CONSTRAINT_SCHEMA AND KCU2.CONSTRAINT_NAME = RC.UNIQUE_CONSTRAINT_NAME "
40084008
"AND KCU2.ORDINAL_POSITION = KCU1.ORDINAL_POSITION "
40094009
"WHERE KCU1.CONSTRAINT_SCHEMA=" + QgsPostgresConn::quotedValue( mSchemaName ) + " AND KCU1.TABLE_NAME=" + QgsPostgresConn::quotedValue( mTableName ) +
4010+
"GROUP BY RC.CONSTRAINT_NAME, KCU1.COLUMN_NAME, KCU2.CONSTRAINT_SCHEMA, KCU2.TABLE_NAME, KCU2.COLUMN_NAME, KCU1.ORDINAL_POSITION " +
40104011
"ORDER BY KCU1.ORDINAL_POSITION"
40114012
);
40124013
QgsPostgresResult sqlResult( connectionRO()->PQexec( sql ) );

0 commit comments

Comments
 (0)
Please sign in to comment.