Skip to content
Permalink
Browse files

More robust detection for domain constraint

git-svn-id: http://svn.osgeo.org/qgis/trunk@15347 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent
mhugent committed Mar 5, 2011
1 parent 155b999 commit 1054cfaa542bd6d641a48792b1fe3de2adaf980d
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/providers/postgres/qgspostgresprovider.cpp
@@ -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 );

0 comments on commit 1054cfa

Please sign in to comment.
You can’t perform that action at this time.