Skip to content

Commit 132d7f2

Browse files
committedAug 7, 2017
Fix postgres server imposed NOT NULL constraint
1 parent 5a64f58 commit 132d7f2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/providers/postgres/qgspostgresprovider.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,7 @@ bool QgsPostgresProvider::skipConstraintCheck( int fieldIndex, QgsFieldConstrain
18281828
{
18291829
// stricter check - if we are evaluating default values only on commit then we can only bypass the check
18301830
// if the attribute values matches the original default clause
1831-
return mDefaultValues.contains( fieldIndex ) && mDefaultValues.value( fieldIndex ) == value.toString();
1831+
return mDefaultValues.contains( fieldIndex ) && mDefaultValues.value( fieldIndex ) == value.toString() && !value.isNull();
18321832
}
18331833
}
18341834

0 commit comments

Comments
 (0)
Please sign in to comment.