Re: COPY FROM and multiple null strings

Поиск
Список
Период
Сортировка
От Joshua D. Drake
Тема Re: COPY FROM and multiple null strings
Дата
Msg-id 45E9C88F.1060906@commandprompt.com
обсуждение исходный текст
Ответ на COPY FROM and multiple null strings  ("Angva" <angvaw@gmail.com>)
Ответы Re: COPY FROM and multiple null strings
Список pgsql-general
Angva wrote:
> Hi,
>
> I've run into a little snag in my data loads, and I come seeking
> advice before I resort to an ugly workaround...
>
> I have a function which runs COPY FROM several times. My problem is
> that my data provider uses symbols to represent nulls - there is a
> different symbol for each different data type. For instance a null
> date would be '1900-01-01' and a null string would be '#'.  Is there
> any way to define multiple null strings in the COPY FROM command?
>
> As always, any suggestions would be much appreciated.

Man... that sounds like eating elementary school spinach... you remember
the kind that slithered down your throat?

There are two immediate ways I can think of to handle this.

1. Write a parser in <insert favorite language) and clean the file
before insertion

2. copy everything into text columns and clean from there.

Joshua D. Drake


>
> Thanks,
> Mark
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
>                http://archives.postgresql.org/
>


--

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/


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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: How Can I set a non standard date format?
Следующее
От: "Martin Gainty"
Дата:
Сообщение: Partition Table