Re: Plan for CSV handling of quotes, NULL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: Plan for CSV handling of quotes, NULL
Date: 2004-04-15 05:06:22
Message-ID: 12202.1082005582@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-04-15 05:18:28 Re: Plan for CSV handling of quotes, NULL
Previous Message Andrew Dunstan 2004-04-15 05:00:22 Re: Plan for CSV handling of quotes, NULL