Re: Converting MySQL tinyint to PostgreSQL
От | Alvaro Herrera |
---|---|
Тема | Re: Converting MySQL tinyint to PostgreSQL |
Дата | |
Msg-id | 20050712143010.GA11315@alvh.no-ip.org обсуждение исходный текст |
Ответ на | Converting MySQL tinyint to PostgreSQL (Joe <svn@freedomcircle.net>) |
Список | pgsql-general |
On Tue, Jul 12, 2005 at 01:16:07AM -0400, Joe wrote: > I have a MySQL database that I'm converting to PostgreSQL which has 10 > columns with TINYINT type, i.e., a one-byte integer. Only one of them > qualifies as a true BOOLEAN. Two are entity identifiers (for limited range > "classes" or "categories") and three others are "type"/code values. The > last four are month numbers or day of month numbers (not implemented as > date types because the year is separate and is part of the primary key). Just to broaden your choices, there is also a "char" datatype (quotes included! If you omit them, it's a different thing, more overhead), which you can use to store a single byte. Could be used as a poor man's ENUM. Add appropiate CHECK constraints and it could be good enough for some purposes. Not useful for months, but maybe for your categories or classes. There are some usages of this in the system catalogs (e.g. pg_class.relkind) -- Alvaro Herrera (<alvherre[a]alvh.no-ip.org>) www.google.com: interfaz de línea de comando para la web.
В списке pgsql-general по дате отправления: