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

Re: dumping query results to a csv

From: Jeff Frost <jeff(at)frostconsultingllc(dot)com>
To: David Durham <ddurham(at)vailsys(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: dumping query results to a csv
Date: 2005-08-25 22:34:46
Message-ID: Pine.LNX.4.63.0508251534160.17113@discord.dyndns.org (view raw or flat)
Thread:
Lists: pgsql-admin
David,

You're probably looking for something like this from the psql man page:

        -F separator

        --field-separator separator
               Use  separator  as  the  field  separator. This is equivalent to
               \pset fieldsep or \f.

I would guess -F "," would do the trick.

On Thu, 25 Aug 2005, David Durham wrote:

> This is kind of a pg-admin newbie question, so apologies in advance.
>
> Anyway, I'd like to issue a command that dumps the results of a query to
> a txt file in comma delimited format.  Does PostgreSQL ship with
> something to do this?  I searched the web, but found what appeared to be
> non-free solutions.
>
> Thanks,
>
> Dave
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

-- 
Jeff Frost, Owner 	<jeff(at)frostconsultingllc(dot)com>
Frost Consulting, LLC 	http://www.frostconsultingllc.com/
Phone: 650-780-7908	FAX: 650-649-1954

In response to

Responses

pgsql-admin by date

Next:From: Adi AlurkarDate: 2005-08-25 22:48:54
Subject: Re: dumping query results to a csv
Previous:From: David DurhamDate: 2005-08-25 22:24:54
Subject: dumping query results to a csv

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