File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1142,7 +1142,7 @@ QString QgsPostgresProvider::getPrimaryKey()
11421142 // oid isn't indexed (and that they may want to add a
11431143 // primary key to the table)
11441144 primaryKey = " oid" ;
1145- primaryKeyType = " int4 " ;
1145+ primaryKeyType = " oid " ;
11461146 mIsDbPrimaryKey = true ;
11471147 }
11481148 else
@@ -1308,7 +1308,7 @@ QString QgsPostgresProvider::getPrimaryKey()
13081308 if ( PQntuples ( oidCheck ) != 0 )
13091309 {
13101310 primaryKey = " oid" ;
1311- primaryKeyType = " int4 " ;
1311+ primaryKeyType = " oid " ;
13121312 }
13131313 else
13141314 {
@@ -2240,7 +2240,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist )
22402240 .arg ( srid );
22412241
22422242 int offset;
2243- if ( primaryKeyType != " tid" )
2243+ if ( primaryKeyType != " tid" && primaryKeyType != " oid " )
22442244 {
22452245 insert += " ," + quotedIdentifier ( primaryKey );
22462246 values += " ,$2" ;
@@ -2346,7 +2346,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist )
23462346 QStringList params;
23472347 params << geomParam;
23482348
2349- if ( primaryKeyType != " tid" )
2349+ if ( primaryKeyType != " tid" && primaryKeyType != " oid " )
23502350 {
23512351 int id = paramValue ( primaryKeyDefault (), primaryKeyDefault () ).toInt ();
23522352 params << QString::number ( id );
You can’t perform that action at this time.
0 commit comments