Re: generate CSV with Copy+Quotes - Postgres 9.2 - Mailing list pgsql-general

From Patrick B
Subject Re: generate CSV with Copy+Quotes - Postgres 9.2
Date
Msg-id CAJNY3iuHE6v7nO=z9QZFzKO-j+LSZWutPUU1KHVbHMKBQhAxgw@mail.gmail.com
Whole thread Raw
In response to Re: generate CSV with Copy+Quotes - Postgres 9.2  (Melvin Davidson <melvin6925@gmail.com>)
List pgsql-general



Perhaps you mean you want to quote of all strings? For that you use FORCE QUOTE.
eg:
    COPY (SELECT
            name_first
            name_last,
            email,
            company
    FROM
            clients
    )
    TO '/var/lib/pgsql/test1.csv' DELIMITER ','
     csv HEADER QUOTE '"';
     FORCE QUOTE name_first, name_last, email, company;

Please RTFM
--  
 


Thanks! FORCE QUOTE was exactly what I needed.

Patrick. 

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: PgSQL versions supported on ubuntu 16 and debian 8
Next
From: Alvaro Herrera
Date:
Subject: Re: PgSQL versions supported on ubuntu 16 and debian 8