]> 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:07:50 +0000 (17:07 -0400)
commit755334ec4e5480d69f80ae479434f2c226b676c5
treeb6d7c7a5c89e5d2c0adf0ef61a899253f204121e
parent7bbf960a3d1fa0a808afc700e4d86ea3e2e79af3
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
(cherry picked from commit ec422fb70e0044ed42dcfda5fb1a7a65db322cf1)
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/dialects/postgresql/base.py
test/dialect/postgresql/test_types.py