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

Re: How to remove quotes from COPY TO result?

From: Joseph Conway <mail(at)joeconway(dot)com>
To: Michael Wood <esiotrot(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Michael Rowan <mike(dot)rowan(at)internode(dot)on(dot)net>, postgresql novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: How to remove quotes from COPY TO result?
Date: 2010-08-10 14:57:56
Message-ID: 4C6168F4.40008@joeconway.com (view raw or flat)
Thread:
Lists: pgsql-novice
On 8/10/10 2:58 AM, Michael Wood wrote:
> On 10 August 2010 00:53, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>> Joe Conway wrote:
>>> COPY abbreviation FROM 'filename' WITH DELIMITER '\t' CSV;
>>> select * from abbreviation;
>>>  id | full_name | short_name
>>> ----+-----------+------------
>>>   1 | STREET    | ST
>>>   2 | ROAD      | RD
>>> (2 rows)
>>
>> How were the double-quotes removed?
> 
> Doesn't the "WITH ... CSV" handle that automatically?

Yes

> The documentation implies to me that quotes would be stripped,
> although it talks more about writing CSV files than reading them.  I
> haven't tried it, though.

It works -- I tried it myself before I posted ;-)

Joe

-- 
Joe Conway
credativ LLC: http://www.credativ.us
Linux, PostgreSQL, and general Open Source
Training, Service, Consulting, & 24x7 Support


In response to

Responses

pgsql-novice by date

Next:From: Bruce MomjianDate: 2010-08-10 15:00:00
Subject: Re: How to remove quotes from COPY TO result?
Previous:From: Michael WoodDate: 2010-08-10 09:58:25
Subject: Re: How to remove quotes from COPY TO result?

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