Re: importing db as text files

Поиск
Список
Период
Сортировка
От Murthy Kambhampaty
Тема Re: importing db as text files
Дата
Msg-id 2D92FEBFD3BE1346A6C397223A8DD3FC0923AF@THOR.goeci.com
обсуждение исходный текст
Ответ на importing db as text files  (expect <expect@ihubbell.com>)
Список pgsql-general
On Friday, August 15, 2003 03:53, expect [mailto:expect@ihubbell.com] wrote:
>On Fri, 15 Aug 2003 00:32:01 -0700 (PDT)
>Stephan Szabo <sszabo@megazone.bigpanda.com> wrote:
>
...
>> Given
>> create table test(
>>  a text default 'abc',
>>  b int default 5
>> );
>>
>> copy test from stdin with delimiter ',';
>> ,
>> \.
>>
>> What would you expect the values of the row in test
>> to be?
>
>
...
>In this case I would expect the row to have:
>
>  a  |  b
>----------
>     |
> abc |  5
>
>
>Is this too much to expect?

Your expectations don't seem consistent with the table definition, which
permits Null values are allowed in (it's ironic you would add "null ''" to
the copy statement, which says you want to treat empty strings as default
values, not null!).

It can be frustrating to deal with postgresql, but I've come to appreciate
the requirement that you clean your data before you COPY it.

Cheers,
    Murthy

PS: Sorry "expect", I meant to send to the list, not directly to you. (I
guess I'd better just hit "reply to all", and not edit the "To:" line.)

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

Предыдущее
От: Rich Parker
Дата:
Сообщение: New to list, quick question.
Следующее
От: expect
Дата:
Сообщение: Re: importing db as text files