Re: [sqlalchemy] Copying enum from one column to another

2018-03-14 Thread Mike Bayer
On Wed, Mar 14, 2018 at 3:09 PM, Colton Allen wrote: > Casting raised this error: > > sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) cannot cast > type outcome_kind to trigger_event > > This is what it looks like in the select: > > cast(outcome.c.kind,

Re: [sqlalchemy] Copying enum from one column to another

2018-03-14 Thread Mike Bayer
On Wed, Mar 14, 2018 at 11:50 AM, Colton Allen wrote: > I'm trying to copy an enum of one type to an enum of another type. The > below is the query I'm using: > > import sqlalchemy as sa > > statement = sa.insert(table_a).from_select(['enum_a'], >

[sqlalchemy] Copying enum from one column to another

2018-03-14 Thread Colton Allen
I'm trying to copy an enum of one type to an enum of another type. The below is the query I'm using: import sqlalchemy as sa statement = sa.insert(table_a).from_select(['enum_a'], sa.select(table_b .c.enum_b)) connection.execute(statement) Which raises this error in Postgres: