Re: COPY formatting

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: COPY formatting
Date: 2004-03-18 16:52:21
Message-ID: 200403181652.i2IGqLH18195@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > Lee Kindness wrote:
> >> To be honest this idea strikes me as overkill - over
> >> engineering.
> >>
> > I agree. My modest proposal for handling CSVs would be to extend the
> > DELIMITER parameter to allow up to 3 characters - separator, quote and
> > escape. Escape would default to the quote char and the quote char would
> > default to unspecified.
>
> I could go with that too. The question here is do we have any popular
> use-cases that aren't solved by that extension, but could be solved by
> simple user-level data formatting functions? I'm not real eager to add
> such a feature as an "if we build it they will come" speculation, but
> if anyone can point to solid use-cases besides handling CSV, then it
> probably is worth doing.

The thing I liked about Andrew's idea is that it even covers escape
quoting for CVS, which might change from implementation to implentation,
and it is flexible without requiring C coding.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jon Jensen 2004-03-18 17:05:12 Re: Further thoughts about warning for costly FK checks
Previous Message Fabien COELHO 2004-03-18 16:51:45 Re: syntax error position "CREATE FUNCTION" bug fix