Queries to Export

Поиск
Список
Период
Сортировка
Искать

Queries to Export

От:
"Warren Murray" <murray_warren@bah.com>
Дата:
I need to export the results of several union and join queries from a
PostgreSQL database tables into text files.  How is that done since the
results is not in a table?

Warren

Re: Queries to Export

От:
"Chandra Sekhar Surapaneni" <chandu@positivenetworks.net>
Дата:
"\o filename";
"select your_query_goes_here;"
"\o"

This should do the trick. Basically \o will start writing the results to
the file. 
"\?" will give you help for such psql commands.

Regards
Chandra Sekhar Surapaneni

-----Original Message-----
From: pgsql-novice-owner@postgresql.org
[mailto:pgsql-novice-owner@postgresql.org] On Behalf Of Warren Murray
Sent: Thursday, February 16, 2006 4:42 PM
To: pgsql-novice@postgresql.org
Subject: [NOVICE] Queries to Export

I need to export the results of several union and join queries from a
PostgreSQL database tables into text files.  How is that done since the
results is not in a table?

Warren

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match


Re: Queries to Export

От:
"Sean Davis" <sdavis2@mail.nih.gov>
Дата:
Look at using in psql:

\o filename
SQL QUERY(IES)
\o

Sean


----- Original Message ----- 
From: "Warren Murray" 
To: 
Sent: Thursday, February 16, 2006 5:41 PM
Subject: [NOVICE] Queries to Export


>I need to export the results of several union and join queries from a
> PostgreSQL database tables into text files.  How is that done since the
> results is not in a table?
> 
> Warren
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
>       choose an index scan if your joining column's datatypes do not
>       match
>

Re: Queries to Export

От:
<operationsengineer1@yahoo.com>
Дата:
--- Chandra Sekhar Surapaneni
 wrote:

> "\o filename";
> "select your_query_goes_here;"
> "\o"
> 
> This should do the trick. Basically \o will start
> writing the results to
> the file. 
> "\?" will give you help for such psql commands.
> 
> Regards
> Chandra Sekhar Surapaneni
> 
> -----Original Message-----
> From: pgsql-novice-owner@postgresql.org
> [mailto:pgsql-novice-owner@postgresql.org] On Behalf
> Of Warren Murray
> Sent: Thursday, February 16, 2006 4:42 PM
> To: pgsql-novice@postgresql.org
> Subject: [NOVICE] Queries to Export
> 
> I need to export the results of several union and
> join queries from a
> PostgreSQL database tables into text files.  How is
> that done since the
> results is not in a table?
> 
> Warren

Warren, i think pgadmin3 has a button that saves the
results of a query to a file.  that may be worth a
try, too.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
FAQ