Re: Plan for CSV handling of quotes, NULL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Plan for CSV handling of quotes, NULL
Дата
Msg-id 12202.1082005582@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Plan for CSV handling of quotes, NULL  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Plan for CSV handling of quotes, NULL  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Particularly, how do we identify a numeric and dates?

We don't, and I'm not convinced that we should.  The entire concept is
suspect in a type-agnostic system.  In particular, I've really got a
problem with the fact that TypeCategory uses a fixed, nonexpansible
set of categories.

Even if you try to push ahead with using TypeCategory, I'd lay a side
bet that it doesn't work.  Will those spreadsheets that make this
nonstandard assumption about quotes having semantic significance be able
to cope with all the possible output formats from timestamptz, for
instance?  How about timetz, which is in the same category?

> The only other thing we could do would be to add something to pg_type
> that says whether it needs quotes.  Seems like overkill.

Seems like wrong.  The real problem here is that "whether it needs
quotes" depends on the program you are intending to export to, the
semantic behavior you want, and likely also the phase of the moon.
I don't think we can hope to invent a COPY behavior rule that
automagically gets this right.  What's needed is a tool that can output
a user-customizable data format, and that seems to me to be outside
COPY's charter.

            regards, tom lane

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

Предыдущее
От: "Andrew Dunstan"
Дата:
Сообщение: Re: Plan for CSV handling of quotes, NULL
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Plan for CSV handling of quotes, NULL