Re: Mysql -> PgSQL

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Mysql -> PgSQL
Дата
Msg-id 200208221425.g7MEP4227162@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Mysql -> PgSQL  (Tommi Maekitalo <t.maekitalo@epgmbh.de>)
Ответы Re: Mysql -> PgSQL  (Tommi Maekitalo <t.maekitalo@epgmbh.de>)
Список pgsql-general
Tommi Maekitalo wrote:
> Am Mittwoch, 21. August 2002 20:18 schrieb Bruce Momjian:
> > Ray Hunter wrote:
> > > I am trying to convert a data type in mysql to postgresql and was
> > > wondering which one i would use in pgsql.
> > >
> > > the type is "set" (example):
> > >
> > > name     set( 'val1', 'val2', 'val3' ) NOT NULL DEFAULT 'val2'
> > >
> > > How can i do that in pgsql?
> >
> > Sure:
> >
> >     x CHAR(4) NOT NULL DEFAULT 'val2' CHECK (x = 'val1' OR x = 'val2' ...)
>
> Thats not so trivial. The type set can have "zero or more values, each of
> which must be chosen from a list of allowed values" (from Mysql-manual). In
> PostgreSQL you have to use a details-table for this. This is a nonstandard
> feature of Mysql (these people concentrate in creating nonstandard extensions
> before supporting the full standard ;-)

Oh, yes, it is enum that is CHECK.  'set' has multiple values.  It is a
nifty MySQL feature, I must say.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

Предыдущее
От: snpe
Дата:
Сообщение: Re: removing duplicates - sql
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: Mysql -> PgSQL