Skip to content


More robust detection for domain constraint
Browse files Browse the repository at this point in the history
git-svn-id: c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Mar 5, 2011
1 parent 3d52473 commit 261ed74
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/providers/postgres/qgspostgresprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2062,8 +2062,7 @@ bool QgsPostgresProvider::parseDomainCheckConstraint( QStringList& enumValues, c
//(VALUE = ANY (ARRAY['a'::text, 'b'::text, 'c'::text, 'd'::text]))
//normally, postgresql creates that if the contstraint has been specified as 'VALUE in ('a', 'b', 'c', 'd')

//todo: ANY must occure before ARRAY
int anyPos = checkDefinition.indexOf( "VALUE=ANY" );
int anyPos = checkDefinition.indexOf( QRegExp( "VALUE\\s*=\\s*ANY\\s*\\(\\s*ARRAY\\s*\\[" ) );
int arrayPosition = checkDefinition.lastIndexOf( "ARRAY[" );
int closingBracketPos = checkDefinition.indexOf( "]", arrayPosition + 6 );

Expand Down

0 comments on commit 261ed74

Please sign in to comment.