File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,8 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
159
159
if ( mCurrentSchema == mSchemaName )
160
160
{
161
161
mUri .clearSchema ();
162
- setDataSourceUri ( mUri .uri () );
163
162
}
163
+
164
164
if ( mSchemaName == " " )
165
165
mSchemaName = mCurrentSchema ;
166
166
@@ -250,6 +250,11 @@ QgsPostgresProvider::QgsPostgresProvider( QString const & uri )
250
250
{
251
251
valid = false ;
252
252
}
253
+ else
254
+ {
255
+ mUri .setKeyColumn ( primaryKey );
256
+ setDataSourceUri ( mUri .uri () );
257
+ }
253
258
254
259
// Close the database connection if the layer isn't going to be loaded.
255
260
if ( !valid )
@@ -1097,9 +1102,6 @@ QString QgsPostgresProvider::getPrimaryKey()
1097
1102
// From the view columns, choose one for which the underlying
1098
1103
// column is suitable for use as a key into the view.
1099
1104
primaryKey = chooseViewColumn ( cols );
1100
-
1101
- mUri .setKeyColumn ( primaryKey );
1102
- setDataSourceUri ( mUri .uri () );
1103
1105
}
1104
1106
}
1105
1107
else
@@ -3159,9 +3161,6 @@ QString QgsPostgresProvider::description() const
3159
3161
return POSTGRES_DESCRIPTION;
3160
3162
} // QgsPostgresProvider::description()
3161
3163
3162
-
3163
-
3164
-
3165
3164
/* *
3166
3165
* Class factory to return a pointer to a newly created
3167
3166
* QgsPostgresProvider object
You can’t perform that action at this time.
0 commit comments