You need to import Enum from sqlalchemy and add a name to it. It should work like this:
from sqlalchemy import Enum
person = Table("user_profile", metadata,
Column("name", String(20)),
Column("gender", Enum("female", "male", name="gender_enum", create_type=False))
);
Related Contents:
- SQL query to get all values a enum can have
- How to delete an enum type value in postgres?
- SQLAlchemy support of Postgres Schemas
- Is there a way to show a user-defined postgresql enumerated type definition?
- How can I do multiple “order_by” in Flask-SQLAlchemy?
- Setting application_name on Postgres/SQLAlchemy
- SQLAlchemy no password supplied error
- How to query a JSON element
- uWSGI, Flask, sqlalchemy, and postgres: SSL error: decryption failed or bad record mac
- Alembic: alter column type with USING
- error: ALTER TYPE … ADD cannot run inside a transaction block
- psql – save results of command to a file
- How to stop/kill a query in postgresql? [duplicate]
- Can PostgreSQL index array columns?
- Truncating all tables in a Postgres database
- How do I change column default value in PostgreSQL?
- Why unsigned integer is not available in PostgreSQL?
- Typecast string to integer
- How to restart Postgresql
- Increment a value in Postgres
- What is PostgreSQL explain telling me exactly?
- The infamous java.sql.SQLException: No suitable driver found
- Adding comment to column when I create table in PostgreSQL?
- PostgreSQL: Remotely connecting to Postgres instance using psql command
- How to create an SQL View with SQLAlchemy?
- How to rename a table inside a schema?
- Postgres SELECT where the WHERE is UUID or string
- What’s the difference between sudo su – postgres and sudo -u postgres?
- Django: CONN_MAX_AGE persists connections, but doesn’t reuse them with PostgreSQL
- PostgreSQL timezone does not match system timezone
- Check Postgres access for a user
- How to add a new Column in a table after the 2nd or 3rd column in the Table using postgres?
- How do I do large non-blocking updates in PostgreSQL?
- Postgresql insert trigger to set value
- CREATE TABLE AS with PRIMARY KEY in one statement (PostgreSQL)
- Turn postgres date representation into ISO 8601 string
- Destroying a Postgres DB on Heroku
- Why command \dt gives – no relations found?
- update if row with some unique value exists, else insert
- Postgres shuts down immediately when started with docker-compose
- Build postgres docker container with initial schema
- pg_dump vs pg_dumpall? which one to use to database backups?
- ERROR: cannot execute CREATE TABLE in a read-only transaction
- PostgreSQL- Filter a date range
- org.postgresql.util.PSQLException: FATAL: no pg_hba.conf entry for host
- How to use volume in docker compose for postgres?
- Postgresql delete old rows on a rolling basis?
- PGAdmin Edit data
- Does PostgreSQL support transparent compressing of tables (fragments)?
- PL/pgSQL perform vs execute