Postgres ENUM data type or CHECK CONSTRAINT?

前端 未结 6 1623
失恋的感觉
失恋的感觉 2021-01-29 23:24

I have been migrating a MySQL db to Pg (9.1), and have been emulating MySQL ENUM data types by creating a new data type in Pg, and then using that as the column definition. My q

6条回答
  •  甜味超标
    2021-01-29 23:58

    PostgreSQL has enum types, works as it should. I don't know if an enum is "better" than a constraint, they just both work.

提交回复
热议问题