[Sqlalchemy-tickets] Issue #4006: Combination of Array and string with explicit collation (PostgreS
Brought to you by:
zzzeek
From: Rudolph F. <iss...@bi...> - 2017-06-08 16:36:24
|
New issue 4006: Combination of Array and string with explicit collation (PostgreSQL) https://bitbucket.org/zzzeek/sqlalchemy/issues/4006/combination-of-array-and-string-with Rudolph Froger: This field: ``` #!python from sqlalchemy.dialects.postgresql import ARRAY ... keywords = Column(ARRAY(Unicode(100, collation='en_US'), dimensions=1)) ``` Gives an error when trying to create all tables: ``` #!python sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) syntax error at or near "[" LINE 7: keywords VARCHAR(100) COLLATE "en_US"[], ``` This is the generated SQL: ``` #!sql CREATE TABLE example_table (keywords VARCHAR(100) COLLATE "en_US"[]); ``` The correct SQL should be: ``` #!sql CREATE TABLE example_table (keywords VARCHAR(100)[] COLLATE "en_US"); ``` |