RE: [HACKERS] Enum type emulation: problem with opaque type in PL/pgSQL functions

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема RE: [HACKERS] Enum type emulation: problem with opaque type in PL/pgSQL functions
Дата
Msg-id NEBBIOAJBMEENKACLNPCEEIPCCAA.chriskl@familyhealth.com.au
обсуждение исходный текст
Ответ на Enum type emulation: problem with opaque type in PL/pgSQL functions  (Max Fonin <fonin@ziet.zhitomir.ua>)
Список pgsql-general
> I don't care how but I need to emulate ENUM type, just to convert
> MySQL dumps to PostgreSQL. E.g. ENUM values
> stored in MySQL dump should be restorable in Postgres without any
> conversion.

In MySQL, ENUM is like this:

create table blah (
    sex ENUM ('M', 'F')
);

This can be emulated in Postgres like this:

create table blah (
    sex CHAR(1) CHECK (sex IN ('M', 'F'))
);

The _real_ trick is implementing MySQL sets in Postgres...

Chris


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

Предыдущее
От:
Дата:
Сообщение: Re: my C pgm
Следующее
От: "Willis, Ian (Ento, Canberra)"
Дата:
Сообщение: RE: Running several postmaster using same database in p arallel