PT3 standard queries

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

Re: PT3 standard queries

Postby kraada » Wed May 27, 2009 6:02 pm

It really sounds like you're running the query on the wrong database. Are you running the query from psql or pgadmin3? If you're using psql, make sure you're connected to the PT3 database (\l to list databases, \connect "Database" to connect to a different database), and if you're using pgadmin make sure it says it's running the query on the right database after you bring up the SQL Query window.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: PT3 standard queries

Postby checkits » Wed May 27, 2009 6:20 pm

So when you change tabs on PT3's gui -- it generates the queries in your postgres log file?


LOL -- Not sure this is progress.... But now -- when I run my query directly in PostGres -- it doesn't write to the log file. It just says

2009-05-27 15:28:15 PDT LOG: database system was shut down at 2009-05-27 15:27:20 PDT
2009-05-27 15:28:15 PDT LOG: autovacuum launcher started
2009-05-27 15:28:15 PDT LOG: database system is ready to accept connections
2009-05-27 15:28:19 PDT LOG: loaded library "$libdir/plugins/plugin_debugger.dll"
2009-05-27 15:32:28 PDT LOG: loaded library "$libdir/plugins/plugin_debugger.dll"
2009-05-27 15:32:31 PDT LOG: loaded library "$libdir/plugins/plugin_debugger.dll"
2009-05-27 15:32:34 PDT LOG: loaded library "$libdir/plugins/plugin_debugger.dll"
checkits
 
Posts: 19
Joined: Thu May 22, 2008 6:55 pm

Re: PT3 standard queries

Postby checkits » Wed May 27, 2009 6:55 pm

The plot thickens....

It wasn't writing to the log anymore where you told me to look (and it was previously). I looked in help and it says this...

Go to File/Options/Logging and set to Errors/Notices/SQL.

So it saves the queries to

C:\Users\Paul\Documents\pgadmin.log

Again, manual queries write there as shown below -- but nothing at all for queries generated by PT3. BTW, i'm using 64 bit OS Vista -- maybe that's my problem.

Code: Select all
2009-05-27 15:49:27 QUERY  : Set query (localhost:5432): SET DateStyle=ISO;SELECT oid, pg_encoding_to_char(encoding) AS encoding, datlastsysoid
  FROM pg_database WHERE oid = 16403
2009-05-27 15:49:35 QUERY  : Thread query (localhost:5432): SELECT
   (   
      Select   hole_cards
      From   lookup_hole_cards
      Where   holdem_hand_player_statistics.id_holecard = lookup_hole_cards.id_holecard
   ) as hole_cards,
      
   
   sum(CASE WHEN holdem_hand_player_statistics.enum_p_3bet_action='N' THEN 1 ELSE 0 END) as N,
   
   sum(CASE WHEN holdem_hand_player_statistics.enum_p_3bet_action='C' THEN 1 ELSE 0 END) as C,
   
   sum(CASE WHEN holdem_hand_player_statistics.enum_p_3bet_action='F' THEN 1 ELSE 0 END) as F,
   sum(CASE WHEN holdem_hand_player_statistics.enum_p_3bet_action='R' THEN 1 ELSE 0 END) as R,
   count(*)



   

FROM holdem_hand_player_statistics
WHERE TRUE
  AND holdem_hand_player_statistics.flg_p_3bet_opp IS TRUE

GROUP BY
   id_holecard

 

2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 1043
2009-05-27 15:49:36 QUERY  : Query result: character varying
2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=1043
2009-05-27 15:49:36 QUERY  : Query result: 1043
2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 20
2009-05-27 15:49:36 QUERY  : Query result: bigint
2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=20
2009-05-27 15:49:36 QUERY  : Query result: 20
2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 20
2009-05-27 15:49:36 QUERY  : Query result: bigint
2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=20
2009-05-27 15:49:36 QUERY  : Query result: 20
2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 20
2009-05-27 15:49:36 QUERY  : Query result: bigint
2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=20
2009-05-27 15:49:36 QUERY  : Query result: 20
2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 20
2009-05-27 15:49:36 QUERY  : Query result: bigint
2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=20
2009-05-27 15:49:36 QUERY  : Query result: 20
2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT format_type(oid,-1) as typname FROM pg_type WHERE oid = 20
2009-05-27 15:49:36 QUERY  : Query result: bigint
2009-05-27 15:49:36 QUERY  : Scalar query (localhost:5432): SELECT CASE WHEN typbasetype=0 THEN oid else typbasetype END AS basetype
  FROM pg_type WHERE oid=20
2009-05-27 15:49:36 QUERY  : Query result: 20


Note: I'm suing PT3 beta 27

Also, do I need to change these values?
#------------------------------------------------------------------------------
# RUNTIME STATISTICS
#------------------------------------------------------------------------------

# - Query/Index Statistics Collector -

#track_activities = on
#track_counts = on
#update_process_title = on
checkits
 
Posts: 19
Joined: Thu May 22, 2008 6:55 pm

Re: PT3 standard queries

Postby checkits » Wed May 27, 2009 7:44 pm

It's working!!!!!!!!!!!!!!!!!!

I changed a few things so I'm not 100% sure this was the fix, but this was disabled -- now it logs EVERYTHING -- so I think I need to change the duration to something higher than zero.

Anyway -- thanks for the help!

log_min_duration_statement = 0 # -1 is disabled, 0 logs all statements
# and their durations, > 0 logs only
# statements running at least this time.
checkits
 
Posts: 19
Joined: Thu May 22, 2008 6:55 pm

Re: PT3 standard queries

Postby kraada » Thu May 28, 2009 9:29 am

I'm glad to hear you got it figured out :)
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Previous

Return to PostgreSQL [Read Only]

Who is online

Users browsing this forum: No registered users and 50 guests

cron
highfalutin