Re: copy files to postgresql

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: copy files to postgresql
Дата
Msg-id 15114.1028642467@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: copy files to postgresql  (Jeff Eckermann <jeff_eckermann@yahoo.com>)
Список pgsql-sql
Jeff Eckermann <jeff_eckermann@yahoo.com> writes:
> I believe that soon-to-be-released version 7.3 will
> have the ability to import data to specific columns,
> as you are trying to do.  For now, you will have to
> edit your input file to insert values (even if null)
> for the missing columns.

A usually-easier way is to make a temp table that matches the column
format of the source file, COPY into that, and then doINSERT INTO finaltable SELECT foo,bar,... FROM temptable
In the INSERT/SELECT it's trivial to do any rearrangement you want.

7.3 will add some more flexibility to COPY, but it only saves a
step, doesn't really do anything you can't do with a temp table.
        regards, tom lane


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

Предыдущее
От: Bruno Wolff III
Дата:
Сообщение: Re: Transitive Closure
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: Transitive Closure