cubicweb/server/sources/native.py
branch3.24
changeset 11926 2deb9f6cbb7b
parent 11776 b49684ddd543
child 11931 ad7796dabeaa
--- a/cubicweb/server/sources/native.py	Wed Jan 18 16:50:48 2017 +0100
+++ b/cubicweb/server/sources/native.py	Fri Jan 20 03:48:11 2017 +0100
@@ -716,10 +716,10 @@
                         rtypes = [c.split('.', 1)[1].strip()[3:] for c in columns]
                         raise UniqueTogetherError(cnx, rtypes=rtypes)
 
-                    mo = re.search('"cstr[a-f0-9]{32}"', arg)
+                    mo = re.search(r'\bcstr[a-f0-9]{32}\b', arg)
                     if mo is not None:
                         # postgresql
-                        raise ViolatedConstraint(cnx, cstrname=mo.group(0)[1:-1])
+                        raise ViolatedConstraint(cnx, cstrname=mo.group(0))
                     if arg.startswith('CHECK constraint failed:'):
                         # sqlite3 (new)
                         raise ViolatedConstraint(cnx, cstrname=arg.split(':', 1)[1].strip())