Re: moving from MySQL to pgsql

Поиск
Список
Период
Сортировка
От Darren Duncan
Тема Re: moving from MySQL to pgsql
Дата
Msg-id 5076100B.4030006@darrenduncan.net
обсуждение исходный текст
Ответ на moving from MySQL to pgsql  (Vineet Deodhar <vineet.deodhar@gmail.com>)
Список pgsql-general
I noticed something here that none of the other replies addressed.

Vineet Deodhar wrote:
> 3) Can I simulate MySQL's TINYINT data-type (using maybe the custom data
> type or something else)

The answer to your question depends on what you were using the TINYINT for.

For example, many people use TINYINT in MySQL to store BOOLEAN (true/false) data
because MySQL doesn't have a real BOOLEAN type; MySQL has the BOOLEAN keyword,
but if you choose it then what you actually get is a TINYINT.

And so, if you are actually using the field just for true/false or 1/0 values,
then Postgres' BOOLEAN type (which is not a number) is the best thing for you to
use.

If you were storing actual numbers outside that range, then use SMALLINT or
something like that.

Any reverse engineering of the MySQL schema will never know you used the BOOLEAN
keyword and just say you have a TINYINT, so you may have to study your schema
and its uses more to know what kind of data/type you actually have.

-- Darren Duncan


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

Предыдущее
От: Ondrej Ivanič
Дата:
Сообщение: Re: moving from MySQL to pgsql
Следующее
От: Gavin Flower
Дата:
Сообщение: Re: Index only scan