Обсуждение: Re: Quoted NULLs with COPY FROM (and pgAdmin export data options)

Поиск
Список
Период
Сортировка

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

От
"George Pavlov"
Дата:
> 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

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

От
Richard Huxton
Дата:
George Pavlov wrote:
>
> 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).

Does sound like something for the pgadmin team.

--
   Richard Huxton
   Archonet Ltd