Multiple Query Reports

PostgreSQL is the database server used to store information. Do you have a question or are you having problem with PostgreSQL? If so, post them here.

Moderator: Moderators

Multiple Query Reports

Postby pr1mo » Mon Sep 21, 2009 7:30 pm

I like to use multiple custom reports exported to the .csv file.

It's a lot of work to do each seperately. Is it possible to export multiple csv's at the same time by running a custom query thru postgres? i don't have much experience going into pgadmin and doing these types of commands so i'm not exactly sure what is all possible there. But if I could build something like that and list each stat I would like and have multiple csv's exported by one command that would be a huge time saver for me :) thanks
pr1mo
 
Posts: 192
Joined: Tue Apr 29, 2008 10:22 pm

Re: Multiple Query Reports

Postby WhiteRider » Tue Sep 22, 2009 4:45 am

I haven't done much with queries in PGAdmin either - kraada or some other users may be able to help you later.
WhiteRider
Moderator
 
Posts: 54018
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: Multiple Query Reports

Postby kraada » Tue Sep 22, 2009 9:02 am

In pgadmin3 if you click on the SQL query icon on the toolbar at the top, then enter your query and click the green play icon that has the little blue disk, it will run the query then save the output to a file for you. It won't split the query up into multiple files, though; I don't know that there is a way to do that gracefully, other than running your single master query as a bunch of smaller queries each of which gets saved to a file.

(For example: Instead of SELECT a, b FROM table; running just SELECT a FROM table; and saving that then running SELECT b FROM table; then saving that.)
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Multiple Query Reports

Postby pr1mo » Wed Sep 23, 2009 5:46 pm

thx kraada, i see in pgadmin3 where i can execute the query but i don't know what to type in exactly. i would like to do a simple query with just player name and then a stat along with filter of between 7-10 players at the table. no # of hands filter or anything else. could you please do me a huge favor and let me know what I type to do that query and also if i want to do 2 at the same time then how to do that with 2 different stats so one will be say PFR and other would be VPIP
pr1mo
 
Posts: 192
Joined: Tue Apr 29, 2008 10:22 pm

Re: Multiple Query Reports

Postby kraada » Wed Sep 23, 2009 6:35 pm

If you know how to do what you want through the custom reports interface, the easiest thing to do is going to be to start by running a few reports that way and then reading the queries yourself. You can find the queries in the log files located in C:\Program Files\PostgreSQL\8.3\data\pg_log. Look at the date of the file for the most recent one and after you click run report open the file and scroll to the bottom and you'll see the query there.

Obviously the more complex your reports are going to be the more complex the query is going to get, but I think that look at examples that way is a good place to start.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 36 guests

cron
highfalutin