Skip to content

Commit

Permalink
Fixes DB manager queries with duplicated field names
Browse files Browse the repository at this point in the history
Fixes #36205
  • Loading branch information
elpaso committed May 29, 2020
1 parent da21127 commit c8eee70
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -1149,7 +1149,11 @@ bool QgsPostgresProvider::loadFields()
if ( fields.contains( fieldName ) )
{
QgsMessageLog::logMessage( tr( "Duplicate field %1 found\n" ).arg( fieldName ), tr( "PostGIS" ) );
return false;
// In case of read-only query layers we can safely ignore the issue
if ( ! mIsQuery )
{
return false;
}
}

fields << fieldName;
Expand Down

0 comments on commit c8eee70

Please sign in to comment.