sqlalchemy with postgres: insert into a table whose columns have parentheses
问题 Suppose you have a table "foo" in postgres with column name "col (parens) name" . The psql command INSERT INTO "foo" ("col (parens) name") VALUES ('bar'); works just fine. However, if I try to do the same using sqlalchemy (version 0.9.7), the resulting python code fails: conn = sqlalchemy.create_engine('postgresql://name:password@host:port/database') meta = sqlalchemy.schema.MetaData() meta.reflect(bind=conn) foo = meta.tables['foo'] vals = [{'col (parens) name': 'hi'}, {'col (parens) name':