File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1142,7 +1142,7 @@ QString QgsPostgresProvider::getPrimaryKey()
1142
1142
// oid isn't indexed (and that they may want to add a
1143
1143
// primary key to the table)
1144
1144
primaryKey = " oid" ;
1145
- primaryKeyType = " int4 " ;
1145
+ primaryKeyType = " oid " ;
1146
1146
mIsDbPrimaryKey = true ;
1147
1147
}
1148
1148
else
@@ -1308,7 +1308,7 @@ QString QgsPostgresProvider::getPrimaryKey()
1308
1308
if ( PQntuples ( oidCheck ) != 0 )
1309
1309
{
1310
1310
primaryKey = " oid" ;
1311
- primaryKeyType = " int4 " ;
1311
+ primaryKeyType = " oid " ;
1312
1312
}
1313
1313
else
1314
1314
{
@@ -2240,7 +2240,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist )
2240
2240
.arg ( srid );
2241
2241
2242
2242
int offset;
2243
- if ( primaryKeyType != " tid" )
2243
+ if ( primaryKeyType != " tid" && primaryKeyType != " oid " )
2244
2244
{
2245
2245
insert += " ," + quotedIdentifier ( primaryKey );
2246
2246
values += " ,$2" ;
@@ -2346,7 +2346,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist )
2346
2346
QStringList params;
2347
2347
params << geomParam;
2348
2348
2349
- if ( primaryKeyType != " tid" )
2349
+ if ( primaryKeyType != " tid" && primaryKeyType != " oid " )
2350
2350
{
2351
2351
int id = paramValue ( primaryKeyDefault (), primaryKeyDefault () ).toInt ();
2352
2352
params << QString::number ( id );
You can’t perform that action at this time.
0 commit comments