[Sqlalchemy-tickets] Issue #4111: Wrong DDL for table creation in Postgresql ARRAY type (zzzeek/sql
Brought to you by:
zzzeek
From: Daniel G. <iss...@bi...> - 2017-10-14 11:30:48
|
New issue 4111: Wrong DDL for table creation in Postgresql ARRAY type https://bitbucket.org/zzzeek/sqlalchemy/issues/4111/wrong-ddl-for-table-creation-in-postgresql Daniel Gonzalez: ``` #!python import sqlalchemy as sa from sqlalchemy.dialects import postgresql from sqlalchemy.schema import CreateTable _metadata = sa.MetaData() t = sa.Table( 'test_table2', _metadata, sa.Column('id', sa.Integer, primary_key=True), sa.Column('city', sa.String), sa.Column('country', sa.String), sa.Column('properties', postgresql.JSONB), sa.Column('languages', postgresql.ARRAY(sa.String, dimensions=1)) ) print(str(CreateTable(t))) ``` Results in incorrect ARRAY column (missing type): ``` #!python CREATE TABLE test_table2 ( id INTEGER NOT NULL, city VARCHAR, country VARCHAR, properties JSONB, languages ARRAY, PRIMARY KEY (id) ) ``` Dialect: pypostgresql and psycopg2 |