Re: Trying to load MySQL data

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Trying to load MySQL data
Дата
Msg-id b42b73150701111102o67f931a9n10e79f0aea52dfb@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Trying to load MySQL data  (Dimitri Fontaine <dim@dalibo.com>)
Ответы Re: Trying to load MySQL data  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-general
On 1/10/07, Dimitri Fontaine <dim@dalibo.com> wrote:
> Hi,
>
> Le mercredi 10 janvier 2007 02:54, garrettmoore@gmail.com a écrit:
> > I am working on a project where we are converting from MySQL to
> > Postgres. I figured the easiest way would be to export the MySQL data
> > as CSV.

If you are using pg 8.2+, I've had good luck with the following:

1. create pgsql schema by hand or using some method, so they match mysql
2. mysqldump --compatible=postgresql [yadda] | grep ^INSERT | psql [yadda]

this will work for most data types. as of 8.2, postgresql supports
multiple record inserts, which while not as fast as copy, is pretty
close.  if mysqldump is dumping single line inserts, change it to
multiple with -e switch iiirc.

merlin

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

Предыдущее
От: Mike Benoit
Дата:
Сообщение: Re: ORDER BY col is NULL in UNION causes error?
Следующее
От: Marcus Engene
Дата:
Сообщение: generate_series with month intervals