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

BUG #4486: CSV feature request

From: "Andrew Grillet" <andrew(at)grillet(dot)co(dot)uk>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4486: CSV feature request
Date: 2008-10-20 10:12:17
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      4486
Logged by:          Andrew Grillet
Email address:      andrew(at)grillet(dot)co(dot)uk
PostgreSQL version: 8.3
Operating system:   Windows XP
Description:        CSV feature request

Excel 2007 decides on the fly whether to quote fields or not on the basis of
whther individual rows have a comma in that field. There does not appear any
obvious way to prevent this bizarre behaviour.

I suggest the syntax:

COPY table (columns) FROM 'filename.csv. with csv OPTIONAL QUOTE [AS '"'];

As a way to tell PostgreSQL this behaviour is expected and must be handled
without complaint. Default should be to complain if file is stupidly

Additionally, where a character that is not a member of the acceptable
character set is found, plese attempt to print it as char as well as
octal/hex. It can be very difficult to find which character is causeing the
problem! (Eg em-dashes, smart quotes)


pgsql-bugs by date

Next:From: anonymousDate: 2008-10-20 17:08:12
Subject: BUG #4487: CLUSTER does not take account of VACUUM statistics
Previous:From: Magnus HaganderDate: 2008-10-20 08:40:21
Subject: Re: BUG #4455: Valid SSL certificate reported as expired

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