Re: Exporting postgres query to CSV

Поиск
Список
Период
Сортировка
От SCassidy@overlandstorage.com
Тема Re: Exporting postgres query to CSV
Дата
Msg-id OFE0CA6758.2E60DA2F-ON88257169.0059E9BA-88257169.005A1042@overlandstorage.com
обсуждение исходный текст
Ответ на Exporting postgres query to CSV  (Ryan Suarez <ryan.suarez@sheridanc.on.ca>)
Ответы Re: Exporting postgres query to CSV  (Nis Jorgensen <nis@superlativ.dk>)
Список pgsql-general
A word of advice: if there is any chance that a column (e.g. text) contains
an embedded newline, you will be much better off outputting the data in
simple xml, instead of CSV.  This works very well with Excel for import.  I
just did a simple program for this recently.

Susan



                  
                           Ryan Suarez
                  
                      <ryan.suarez@sheridanc.        To:       pgsql-general@postgresql.org
                  
                      on.ca>                         cc:
                  
                           Sent by:                  Subject:  [GENERAL] Exporting postgres query to CSV
                  

                  
                                                      |-------------------|
                  
                      pgsql-general-owner@pos         | [ ] Expand Groups |
                  
                      tgresql.org                     |-------------------|
                  

                  

                  
                           05/09/2006 07:58
                  
                      AM
                  

                  

                  




Greetings,

I am running postgres 7.4.7 on debian sarge.

I need to run an SQL query and store the results in a file.  The format
needs to be comma separated values (CSV), so I can import this later in
Excel.

Any ideas on how to accomplish this?

much appreciated,
Ryan


---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend





----------------------------------------------------------------------------------------------
Simply protected storage solutions ensure that your information is
automatically safe, readily available and always there, visit us at http://www.overlandstorage.com
----------------------------------------------------------------------------------------------


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump and grants to PUBLIC
Следующее
От: Blair Lowe
Дата:
Сообщение: Re: pg_dump and grants to PUBLIC