Skip to content

Commit 261ed74

Browse files
author
mhugent
committedMar 5, 2011
More robust detection for domain constraint
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@15347 c8812cc2-4d05-0410-92ff-de0c093fc19c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

‎src/providers/postgres/qgspostgresprovider.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,8 +2062,7 @@ bool QgsPostgresProvider::parseDomainCheckConstraint( QStringList& enumValues, c
20622062
//(VALUE = ANY (ARRAY['a'::text, 'b'::text, 'c'::text, 'd'::text]))
20632063
//normally, postgresql creates that if the contstraint has been specified as 'VALUE in ('a', 'b', 'c', 'd')
20642064

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

0 commit comments

Comments
 (0)
Please sign in to comment.