Converting MySQL tinyint to PostgreSQL

Поиск
Список
Период
Сортировка
От Joe
Тема Converting MySQL tinyint to PostgreSQL
Дата
Msg-id 42D35217.5050802@freedomcircle.net
обсуждение исходный текст
Ответы Re: Converting MySQL tinyint to PostgreSQL  (John DeSoi <desoi@pgedit.com>)
Re: Converting MySQL tinyint to PostgreSQL  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Converting MySQL tinyint to PostgreSQL  (Dawid Kuroczko <qnex42@gmail.com>)
Re: Converting MySQL tinyint to PostgreSQL  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-general
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).

I'm wondering what would be the best conversion choice for these columns:
smallint, numeric(1), char(1), something else?  AFAICT, the application does not
directly do any arithmetic on these columns, but the identifier and code types
are used as indices into PHP arrays.  The month/day values are formatted into
dates for display (and the month also servers as an index into a month-name array).

BTW, is TINYINT part of any SQL Standard?

Joe


В списке pgsql-general по дате отправления:

Предыдущее
От: Joseph Shraibman
Дата:
Сообщение: Re: table locking and SELECT FOR UPDATE
Следующее
От: John DeSoi
Дата:
Сообщение: Re: Converting MySQL tinyint to PostgreSQL