Re: dumping query results to a csv

Поиск
Список
Период
Сортировка
От Jeff Frost
Тема Re: dumping query results to a csv
Дата
Msg-id Pine.LNX.4.63.0508251602090.17113@discord.dyndns.org
обсуждение исходный текст
Ответ на Re: dumping query results to a csv  (Jeff Frost <jeff@frostconsultingllc.com>)
Список pgsql-admin
Whoops, should have also mentioned that you want -P format=unaligned like so:

psql -P format=unaligned -F ',' snort <<EOF
select * from iphdr;
EOF

On Thu, 25 Aug 2005, Jeff Frost wrote:

> 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@frostconsultingllc.com>
Frost Consulting, LLC     http://www.frostconsultingllc.com/
Phone: 650-780-7908    FAX: 650-649-1954

В списке pgsql-admin по дате отправления:

Предыдущее
От: Adi Alurkar
Дата:
Сообщение: Re: dumping query results to a csv
Следующее
От: "Jim C. Nasby"
Дата:
Сообщение: Re: dumping query results to a csv