Lead and tail quotes with \pset fieldsep

From: "Bath, David" <dave(dot)bath(at)unix(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Lead and tail quotes with \pset fieldsep
Date: 2006-03-19 23:37:07
Message-ID: 200603201037.07638.dave.bath@unix.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Folks

If I want psql to generate CSV files fully-double-quoted I can
use pset as follows
psql> \pset fieldsep ","
However this does not put a quote before the first field and
after the last, so each row comes out as
1234","blahblah","sdfgsg","foo","bar

Is there a way to use psql to give rows like
1234","blahblah","sdfgsg","foo","bar
or is there another tool I should use.

COPY doesn't deal with views and restrictions well so it is
not an option.

Thanks in advance
--
David T. Bath
dave(dot)bath(at)unix(dot)net

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2006-03-20 01:14:55 Re: Lead and tail quotes with \pset fieldsep
Previous Message Svenne Krap 2006-03-19 13:39:17 Re: How to call table returning function with other table