Unix Technical Forum

Re: Queries to Export

This is a discussion on Re: Queries to Export within the pgsql Novice forums, part of the PostgreSQL category; --> "\o filename"; "select your_query_goes_here;" "\o" This should do the trick. Basically \o will start writing the results to the ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Novice

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-17-2008, 10:36 PM
Chandra Sekhar Surapaneni
 
Posts: n/a
Default Re: Queries to Export

"\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
[mailtogsql-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



---------------------------(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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-17-2008, 10:36 PM
operationsengineer1@yahoo.com
 
Posts: n/a
Default Re: Queries to Export

--- Chandra Sekhar Surapaneni
<chandu@positivenetworks.net> 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
> [mailtogsql-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

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:19 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com