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:

Error: (psycopg2.ProgrammingError) column "enum_a" is of type enum_a but 
expression is of type enum_b

Is there a way to parse the enum to its string-value and just insert that?

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to