Skip site navigation (1) Skip section navigation (2)

Re: Note that spaces between QUOTE and DELIMITER are included

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Darcy Buskermolen <darcy(at)wavefire(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Note that spaces between QUOTE and DELIMITER are included
Date: 2005-09-02 19:16:14
Message-ID: 4318A4FE.30207@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-patches

Darcy Buskermolen wrote:

>+       CSV mode will include all characters between <literal>QUOTE</> and 
>+       <literal>DELIMITER</> in the value for the field, this is of special
>+       attention to those who use CSV mode to import data from other RDBMS
>+       systems that create fixed width CSV files.
>  
>

First, this need some grammar cleanup. But more importantly, it's not 
quite a correct formulation. CSV mode splits a line on (unquoted) 
delimiters. Within each chunk dequoting is done, and withing quoted 
sections de-escaping is done. But nothing is discarded.

i.e. with the quote char as '"', 'foo"bar"baz' becomes 'foobarbaz' and ' 
"x" ' becomes ' x '.

I understand Dary's problem has been that Oracle pads CSV lines with 
spaces. Perhaps we need to warn specifically about that - I suspect most 
people for whom it might be important will miss the significance otherwise.

I'll work on some better wording.

cheers

andrew

In response to

Responses

pgsql-patches by date

Next:From: Josh BerkusDate: 2005-09-02 19:29:41
Subject: Re: PL/pgSQL: EXCEPTION NOSAVEPOINT
Previous:From: Darcy BuskermolenDate: 2005-09-02 16:56:43
Subject: Note that spaces between QUOTE and DELIMITER are included in the field during CVS COPY.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group