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

COPY without quoting

From: Lee Hachadoorian <lee(dot)hachadoorian(at)gmail(dot)com>
To: "PostgreSQL (SQL)" <pgsql-sql(at)postgresql(dot)org>
Subject: COPY without quoting
Date: 2012-03-15 16:16:14
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
COPY ... TO ... WITH CSV defaults to quoting string fields with embedded 
delimiters, quotes, and newlines. In pgAdmin I can execute to file and 
specify "no quoting" for the output, in which case I get (what I want) a 
file with no quotes, even though there are embedded commas in the 
strings. But I am missing it if the COPY statement has a way to turn 
quotes off. You can turn them *on* with FORCE QUOTE, in which case a 
column will be quoted even if there are no embedded delimiters, etc. I 


but got a message that the quote string had to be at least one character.

Any ideas?


Lee Hachadoorian
PhD, Earth&  Environmental Sciences (Geography)
Research Associate, CUNY Center for Urban Research


pgsql-sql by date

Next:From: Tom LaneDate: 2012-03-15 16:23:34
Subject: Re: COPY without quoting
Previous:From: David JohnstonDate: 2012-03-14 12:30:25
Subject: Re: help on a function with exception

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