Skip to content

Instantly share code, notes, and snippets.

@jef-n
Created January 17, 2012 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jef-n/1628301 to your computer and use it in GitHub Desktop.
Save jef-n/1628301 to your computer and use it in GitHub Desktop.
diff --git a/src/providers/postgres/qgspostgresprovider.cpp b/src/providers/postgres/qgspostgresprovider.cpp
index a1ecaa2..8c8d3e8 100644
--- a/src/providers/postgres/qgspostgresprovider.cpp
+++ b/src/providers/postgres/qgspostgresprovider.cpp
@@ -1949,7 +1949,7 @@ bool QgsPostgresProvider::addFeatures( QgsFeatureList &flist )
}
for ( int i = 0; i < fieldId.size(); i++ )
- params << paramValue( attributevec[ fieldId[i] ].toString(), defaultValues[i] );
+ params << paramValue( attributevec.value( fieldId[i], defaultValues[i] ).toString(), defaultValues[i] );
QgsPostgresResult result = mConnectionRW->PQexecPrepared( "addfeatures", params );
if ( result.PQresultStatus() == PGRES_FATAL_ERROR )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment