Re: help with COPY query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: help with COPY query
Дата
Msg-id 12493.1078027256@sss.pgh.pa.us
обсуждение исходный текст
Ответ на help with COPY query  (Elinor Medezinski <elinor@bellatrix.tau.ac.il>)
Список pgsql-novice
Elinor Medezinski <elinor@bellatrix.tau.ac.il> writes:
> I want to load a file containning a column of FLOATS, into a table of
> INTEGERs.
> ...
> How can I go around this problem? is there any way to force copy to do the
> right casting?

COPY is not designed to do data manipulation for you.  The best bet is
to load the data file into a temp table that has a column set matching
the data file, and then use INSERT ... SELECT to transform the data
and insert it into the final table.

            regards, tom lane

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