Page 1 of 1

Multiple Query Reports

PostPosted: Mon Sep 21, 2009 7:30 pm
by pr1mo
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

Re: Multiple Query Reports

PostPosted: Tue Sep 22, 2009 4:45 am
by WhiteRider
I haven't done much with queries in PGAdmin either - kraada or some other users may be able to help you later.

Re: Multiple Query Reports

PostPosted: Tue Sep 22, 2009 9:02 am
by kraada
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.)

Re: Multiple Query Reports

PostPosted: Wed Sep 23, 2009 5:46 pm
by pr1mo
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

Re: Multiple Query Reports

PostPosted: Wed Sep 23, 2009 6:35 pm
by kraada
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.