cash_hand_player_statistics.flg_f_second needed

Let us know what features not currently in the PT4 should be added.

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

Re: cash_hand_player_statistics.flg_f_second needed

Postby pasita » Sat Sep 07, 2013 8:54 pm

So basically your function will be called for every hand you have on a specific player

Yeah, I guess there's no way to overcome that part (at the function level).

Off to build a hundred columns then. Or run the stuff periodically outside PT4 and inject the stats into the player notes. Or wait a couple of secs to see regs' stats pop up in a popup.

Using the aggregates in PT4 columns loses a lot of control, can't do stuff like ordering the data any more at that point. Which is why I got interested in the function stuff, after seeing the cool stuff you did with those.

BTW my main purpose wasn't to cram a lot of data into one stat, but I tried out the format("data 1 {1} data 2 {2}", col_1, col_2) stuff, seems to work fine. Can't think of a practical purpose for that yet... but when there's way, there will be will:)
pasita
 
Posts: 605
Joined: Tue May 06, 2008 4:05 pm

Re: cash_hand_player_statistics.flg_f_second needed

Postby ommaha » Fri Jan 17, 2014 9:36 pm

BillGatesIII wrote:If you run this in pgAdmin, it will create a computed database field that will return what you need.

Code: Select all
create or replace function str_toact_f(cash_hand_summary)
returns text as
$body$
select array_to_string(array_agg(chps.position order by position desc), '')
from cash_hand_player_statistics chps
where chps.id_hand = $1.id_hand
and chps.flg_f_saw;
$body$
language sql stable
cost 100;
alter function str_toact_f(cash_hand_summary)
owner to postgres;


You can use this field like any other field in a column.


At first my apologies that it took me so long to answer here and to try that. I have 9.0 on my laptop now. So, I tried and I it looks promising.
Atm I am a bit confused though as I tried to work with it. I programmed a custom stat containing

substring(cash_hand_summary.str_toact_f from 1 to 1)::int > 0

and by clicking "validate" it tells me "statistic is valid". But when I add the stat to a popup all the popups never get shown. Seems like an endless loop. As soon as I remove the stat the popups appear again. I tried the same with using it in the HUD ... with same result.

How can I solve that? Thanks very much!
ommaha
 
Posts: 228
Joined: Sun Jul 29, 2012 8:46 am

Re: cash_hand_player_statistics.flg_f_second needed

Postby BillGatesIII » Sat Jan 18, 2014 8:15 am

It looks like some PT4 update did break computed database fields. I just run a quick test and see this in the log.

2014/01/18 13:06:25.123 [00020]: [000009B0][TableManager] Query Failure [35]: Unable to execute query: SELECT (player.player_name_search) as "str_player_name_search", (player.id_site) as "id_site_player", (sum((case when(cash_hand_player_statistics.id_hand > 0) then 1 else 0 end))) as "cnt_hands", (string_agg(cash_hand_summary.str_toact_f, '')) as "str_test" FROM cash_limit, cash_hand_player_statistics, cash_hand_summary, player WHERE
...
GROUP BY (player.player_name_search), (player.id_site) ; Reason: Fatal Error (ERROR: column cash_hand_summary.str_toact_f does not exist LINE 1: ...


If I copy-paste the SQL into pgAdmin it runs without errors and returns the correct result.

I'll have to think of another way to get str_toact_x. Can take a couple of days though :D
BillGatesIII
 
Posts: 740
Joined: Fri Dec 16, 2011 6:50 pm

Re: cash_hand_player_statistics.flg_f_second needed

Postby ommaha » Mon Jan 20, 2014 5:33 pm

thank you very much for trying!
ommaha
 
Posts: 228
Joined: Sun Jul 29, 2012 8:46 am

Re: cash_hand_player_statistics.flg_f_second needed

Postby BillGatesIII » Mon Feb 03, 2014 12:08 pm

Please ignore my last post. I was testing some new stats and had different databases selected in the Advanced Hud Configuration. The function wasn't created in all the databases.

@ommaha: Do you have more than one database read from?
BillGatesIII
 
Posts: 740
Joined: Fri Dec 16, 2011 6:50 pm

Re: cash_hand_player_statistics.flg_f_second needed

Postby ommaha » Thu Feb 06, 2014 10:07 am

yes, i use 2 databases.
so, creating the function in all databases would solve the problem?
ommaha
 
Posts: 228
Joined: Sun Jul 29, 2012 8:46 am

Re: cash_hand_player_statistics.flg_f_second needed

Postby kraada » Thu Feb 06, 2014 10:48 am

Yes you'll need to create it in all databases.
kraada
Moderator
 
Posts: 54430
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: cash_hand_player_statistics.flg_f_second needed

Postby ommaha » Thu Feb 06, 2014 12:27 pm

it works.

THANK YOU VERY MUCH !!!
ommaha
 
Posts: 228
Joined: Sun Jul 29, 2012 8:46 am

Re: cash_hand_player_statistics.flg_f_second needed

Postby BillGatesIII » Thu Feb 06, 2014 1:14 pm

You're welcome, good to hear it works :)
BillGatesIII
 
Posts: 740
Joined: Fri Dec 16, 2011 6:50 pm

Re: cash_hand_player_statistics.flg_f_second needed

Postby ommaha » Mon May 19, 2014 4:35 pm

[ img ]
i tried to update to pt4.11 and got this error message

the same message came up for all the databases i used cash_hand_summary.str_toact_f. others are not affected. what does it mean? and how can i update the affected databases? i tried to update to 4.11 because the performance regarding custom stats is probably better than in 4.09.

any help very much appreciated
ommaha
 
Posts: 228
Joined: Sun Jul 29, 2012 8:46 am

PreviousNext

Return to PT4 Feature Requests

Who is online

Users browsing this forum: No registered users and 0 guests