]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Render ARRAY index embedded between type and COLLATE
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 8 Jun 2017 16:55:23 +0000 (12:55 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 8 Jun 2017 21:06:53 +0000 (17:06 -0400)
commitec422fb70e0044ed42dcfda5fb1a7a65db322cf1
treec8b2f949883eb31d12511ac9d3c5c565afc73017
parentb6d3f60791834ead92564fc58afebc2c3eb4a2ff
Render ARRAY index embedded between type and COLLATE

Fixed bug where using :class:`.ARRAY` with a string type that
features a collation would fail to produce the correct syntax
within CREATE TABLE.

The "COLLATE" must appear to the right of the array dimensions,
so we are using regexp substitution to insert the brackets in the
appropriate place.  A more heavyweight solution would be that datatypes
know how to split up their base type vs. modifiers, but as this is
so specific to Postgresql ARRAY it's better to handle these cases
more locally.

Change-Id: I394c3c673eb60689e51b5301e51651972cfdb4c0
Fixes: #4006
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_types.py