Re: Quoted NULLs with COPY FROM (and pgAdmin export data options)

Поиск
Список
Период
Сортировка
От George Pavlov
Тема Re: Quoted NULLs with COPY FROM (and pgAdmin export data options)
Дата
Msg-id CCB89282FCE1024EA3DCE687A96A51640471F87B@ehost010-6.exch010.intermedia.net
обсуждение исходный текст
Ответы Re: Quoted NULLs with COPY FROM (and pgAdmin export data  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
> Quotes tend to imply a text field.

I think you meant to say "quotes imply a non-null text field". And, yes,
I am quite aware of that. The point of the thread was to see if there is
any way of avoiding/overriding that assumption.

> Assuming
> you don't want to write a short Perl script to pre-process
> the file the
> simplest way would be to import into a temporary table with
> text columns
> rather than numeric, then copy from that into the real table
> (with CASE  or two queries).

Yes, both are valid alternatives. The point was to see if I could skip
those steps.

This is actually turning into a bit of a pgAdmin issue: pgAdmin lets you
export data in a format that seems to be unimportable back into the same
table. If in the "Export data to file" form you check "all columns"
under "Quoting" you will get quotes around your numeric NULLs that you
will be unable to import back using COPY without resorting to
preprocessing of some sort (unless someone tells me how COPY can use
quoted NULLs).

George

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

Предыдущее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Does this look ethical to you?
Следующее
От: Yl Zhou
Дата:
Сообщение: Re: user defined function