From: Mike Bayer Date: Mon, 5 Mar 2018 16:33:30 +0000 (-0500) Subject: Only replace first occurrence for COLLATE/ARRAY syntax X-Git-Tag: rel_1_1_18~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cc6ec001b29d84a00aba57473213c8448118a3c5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Only replace first occurrence for COLLATE/ARRAY syntax Fixed bug in Postgresql COLLATE / ARRAY adjustment first introduced in :ticket:`4006` where new behaviors in Python 3.7 regular expressions caused the fix to fail. Change-Id: Ied3893d7cac210befa0277b55b3b895b0ba1f0d2 Fixes: #4208 (cherry picked from commit 7300469f71f161d47795dcf7415d5a22db8e2ef0) --- diff --git a/doc/build/changelog/unreleased_11/4208.rst b/doc/build/changelog/unreleased_11/4208.rst new file mode 100644 index 0000000000..517c83d8fe --- /dev/null +++ b/doc/build/changelog/unreleased_11/4208.rst @@ -0,0 +1,8 @@ +.. change:: + :tags: bug, postgresql, py3k + :tickets: 4208 + :versions: 1.2.5, 1.3.0b1 + + Fixed bug in Postgresql COLLATE / ARRAY adjustment first introduced + in :ticket:`4006` where new behaviors in Python 3.7 regular expressions + caused the fix to fail. diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index c25a9bea10..6bc3d55fee 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1907,7 +1907,8 @@ class PGTypeCompiler(compiler.GenericTypeCompiler): "[]" * (type_.dimensions if type_.dimensions is not None else 1) )), - inner + inner, + count=1 )