enumeration datatype in postgresql?

Started by Marc Lambrichsover 24 years ago2 messagesgeneral
Jump to latest
#1Marc Lambrichs
marcl@xs4all.nl

Is there an enumeration datatype in postgresql like the enum in mysql?

Cheers,
Marc

#2Szabo Zoltan
col@econet.hu
In reply to: Marc Lambrichs (#1)
Re: enumeration datatype in postgresql?

Hi, enum is a very stupid thing in mysql :)
Use check in psql.
http://www.postgresql.org/idocs/index.php?sql-createtable.html
Sample:
create table mytable (
shortcut char(2) check (shortcut in ('en','nl','de'))
);

Marc Lambrichs wrote:

Show quoted text

Is there an enumeration datatype in postgresql like the enum in mysql?

Cheers,
Marc