Re: help with COPY query

Поиск
Список
Период
Сортировка
От Bruno LEVEQUE
Тема Re: help with COPY query
Дата
Msg-id Pine.LNX.4.58.0402290050250.1028@moissac.leveque.fr
обсуждение исходный текст
Ответ на help with COPY query  (Elinor Medezinski <elinor@bellatrix.tau.ac.il>)
Список pgsql-novice
Hi,

I think the better is to modify you file before.
With sed it should be something like :

sed "s/\(\tab[0-9][0-9]*\).[0-9][0-9]*\(\tab\)/\1\2/" file > newfile

where \tab is the tabulation (or ctrl-V ctrl-I)

You can do the same with vi

vi file
:%s/\(\tab[0-9][0-9]*\).[0-9][0-9]*\(\tab\)/\1\2/
:wq

Bruno


On Tue, 24 Feb 2004, Elinor Medezinski wrote:

> Hi,
> I want to load a file containning a column of FLOATS, into a table of
> INTEGERs.
>
> I tried:
>     COPY "Field" ("myintegers") from './myfloats.txt';
> but got an error message:
>     ERROR:  invalid input syntax for integer: "15.0"
>     CONTEXT:  COPY Field, line 1, column WatchFreq: "15.0"
> How can I go around this problem? is there any way to force copy to do the
> right casting?
>
> Thanks in advance,
> Elinor
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
>       subscribe-nomail command to majordomo@postgresql.org so that your
>       message can get through to the mailing list cleanly
>
>

Bruno LEVEQUE
System Engineer
SARL NET6D
bruno.leveque@net6d.com
http://www.net6d.com

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

Предыдущее
От: root
Дата:
Сообщение: Re: easy backup?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Compilation issue with --enable-thread-safety