Want to make a column in psql

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Want to make a column in psql

Postby spapia00 » Thu Feb 04, 2010 9:15 am

Hello. I know how to add a custom stat on PT3 (for purpose of using HUD). But when I add a new stat, it seems not actually make a new column in psql database.

What I trying to do is, to make a real column in psql database and let it be updated automatically when every single hand is imported. That means I can query like this. Is this possible?

Code: Select all
select sum(case when flg_f_donk then 1 else 0 end), sum(case when flg_f_donk_opp then 1 else 0 end) from holdem_hand_player_statistics where id_player=blahblah


For example, Donk Flop Opp
Code: Select all
holdem_hand_player_statistics.flg_p_face_raise AND holdem_hand_player_detail.flg_f_open_opp AND NOT holdem_hand_player_statistics.flg_f_cbet_opp
AND (holdem_hand_player_detail.val_p_raise_aggressor_pos < holdem_hand_player_statistics.position AND (holdem_hand_player_detail.val_p_raise_aggressor_pos != (holdem_hand_summary.cnt_players-1)))


I see flg_t_donk_opp and flg_r_donk_opp exist in psql database, but not for flg_f_donk_opp after I inserted hand_flop_donk_opp.pt3stat. U know when I query this custom stat Donk Flop Opp outside PT3 (like outside program written in VC++ using psql driver), it need to be calculated and cause lag.
spapia00
 
Posts: 16
Joined: Fri Apr 04, 2008 3:42 am

Re: Want to make a column in psql

Postby kraada » Thu Feb 04, 2010 9:30 am

The flop donkbet statistics are available in the repository, you can just download and use them from there.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Want to make a column in psql

Postby spapia00 » Thu Feb 04, 2010 9:34 am

kraada wrote:The flop donkbet statistics are available in the repository, you can just download and use them from there.


Yes I know how to use these in PT3. What I want to know is how can I use these stats outside of PT3. Like I wrote above, I can do query Donk Turn/River (because it really exist in psql column). But for Donk Flop, I have to make query to calculate...
spapia00
 
Posts: 16
Joined: Fri Apr 04, 2008 3:42 am

Re: Want to make a column in psql

Postby doco » Thu Feb 04, 2010 9:58 am

Not sure you want to be altering existing objects in the PT/Postgres database. For one thing housekeeping may complain and updates may overwrite your alterations. You could create a new table and populate that with the data you want or create a view or stored procedure, etc.
doco
 
Posts: 130
Joined: Mon Sep 08, 2008 4:04 am
Location: E. Oregon USA

Re: Want to make a column in psql

Postby spapia00 » Fri Feb 05, 2010 10:27 am

Well, creating new table might be a solution. Whenever every single(or tenth?) hand recorded, i make a new table containing a new column. But it's quite inefficient in regard of space... I wish I could modify PT3's hand parsing algorithm (to make it fill a new column...). But then housekeeping also need to be changed.

BTW, can we ask PT3 to add few useful stat to be built-in?
spapia00
 
Posts: 16
Joined: Fri Apr 04, 2008 3:42 am

Re: Want to make a column in psql

Postby kraada » Fri Feb 05, 2010 10:53 am

If it's a stat you can build already using custom statistics it's doubtful that we'll add it as a built in column.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY


Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 0 guests