Re: COPY table to file missing quotation marks - Mailing list pgsql-general

From Rich Shepard
Subject Re: COPY table to file missing quotation marks
Date
Msg-id alpine.LNX.2.00.1301310852360.32615@salmo.appl-ecosys.com
Whole thread Raw
In response to Re: COPY table to file missing quotation marks  (Adrian Klaver <adrian.klaver@gmail.com>)
Responses Re: COPY table to file missing quotation marks  (Adrian Klaver <adrian.klaver@gmail.com>)
List pgsql-general
On Thu, 31 Jan 2013, Adrian Klaver wrote:

> http://www.postgresql.org/docs/9.2/interactive/sql-copy.html

Adrian,

   I've read this.

> CSV Format
> ...
> "The values in each record are separated by the DELIMITER character. If
> the value contains the delimiter character, the QUOTE character, the NULL
> string, a carriage return, or line feed character, then the whole value is
> prefixed and suffixed by the QUOTE character, and any occurrence within
> the value of a QUOTE character or the ESCAPE character is preceded by the
> escape character.  You can also use FORCE_QUOTE to force quotes when
> outputting non-NULL values in specific columns." ...

   So, if the column attribute is text of some flavor I still need to force
quotes column-by-column?

   Guess I still need to import the output into a spreadsheet, format each
text and date column, then write it out again as a .csv file ... or, better
yet, write a one-line awk program that quotes the appropriate tokens! That's
what I'll do.

Thanks,

Rich



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: COPY table to file missing quotation marks
Next
From: Steve Crawford
Date:
Subject: Re: COPY table to file missing quotation marks