Page 1 of 1

Error when importing hands

PostPosted: Tue Dec 14, 2021 8:00 pm
by Vladislav1975
HI,
When importing all the hands when playing at the cash table, an error appears:

PokerStars: Unable to import hand (#232224166051). Reason: Error: Unable to execute query: Fatal Error; Reason: Error: (ERROR: column lookup_hole_cards.flg_pair does not exist LINE 1: ...won_hand) then 1 else 0 end))), (sum((case when(lookup_hol... ^ QUERY: SELECT chps.id_player, chps.id_gametype, chps.id_limit, chs.cnt_players,((case when( lookup_positions.flg_sb) then 0 else (case when( lookup_positions.flg_bb) then 1 else (case when( lookup_positions.flg_ep) then 2 else (case when( lookup_positions.flg_mp) then 3 else (case when( lookup_positions.flg_co) then 4 else 5 end) end) end) end) end)), (chps.flg_f_has_position), (chps.flg_t_has_position), (chps.flg_r_has_position), (CAST ( ((date_part('year', timezone('UTC', chps.date_played + INTERVAL '0 HOURS')) * 100) + (EXTRACT (WEEK FROM timezone('UTC', chps.date_played + INTERVAL '0 HOURS')))) AS integer )), (sum((case when( ( (chps.amt_f_bet_facing > 0 AND (lookup_actions_f.action SIMILAR TO '(R|XR)%')) OR chps.flg_f_3bet OR chps.flg_f_4bet ) AND ( lookup_actions_f.action SIMILAR TO '(%R)' ) ) then 1 else 0 end)) ), (sum((case when( ( chps.amt_f_bet_facing > 0 OR chps.flg_f_3bet_opp OR chps.flg_f_4bet_opp ) ) then 1 else 0 end))), (sum((case when((chps.amt_f_bet_facing > 0 AND (lookup_actions_f.action SIMILAR TO '(R|XR)%')) OR chps.flg_f_3bet OR chps.flg_f_4bet AND chps.flg_showdown ) then 1 else 0 end)) ), (sum((case when(((chps.amt_f_bet_facing > 0 AND (lookup_actions_f.action SIMILAR TO '(R|XR)%')) OR chps.flg_f_3bet OR chps.flg_f_4bet) AND chps.flg_showdown AND chps.flg_won_hand ) then 1 else 0 end)) ), (sum( (case when( (chps.flg_f_bet OR chps.flg_f_check OR chps.cnt_f_call > 0 OR chps.cnt_f_raise > 0 OR chps.flg_f_fold) AND chps.flg_showdown ) then 1 else 0 end) )), (sum( (case when( (chps.flg_f_bet OR chps.flg_f_check OR chps.cnt_f_call > 0 OR chps.cnt_f_raise > 0) AND chps.flg_showdown AND chps.flg_won_hand ) then 1 else 0 end) )), (sum((case when(chps.flg_f_bet AND ( (chs.str_aggressors_f != substring (chs.str_actors_f for 1) AND chps.flg_f_fold ) OR (chs.str_aggressors_f = substring (chs.str_actors_f for 1) AND (chps.flg_t_fold OR chps.flg_t_check OR chps.cnt_t_call > 0 OR chps.flg_t_bet OR chps.cnt_t_raise > 0 ) ) ) ) then 1 else 0 end))), (sum((case when( chps.flg_f_bet AND chps.flg_showdown AND ( (chs.str_aggressors_f != substring (chs.str_actors_f for 1) AND chps.flg_f_fold ) OR (chs.str_aggressors_f = substring (chs.str_actors_f for 1) AND (chps.flg_t_fold OR chps.flg_t_check OR chps.cnt_t_call > 0 OR chps.flg_t_bet OR chps.cnt_t_raise > 0 ) ) ) ) then 1 else 0 end))), (sum( (case when( (chps.flg_f_bet OR chps.cnt_f_call > 0 OR chps.cnt_f_raise > 0 OR chps.flg_f_fold) ) then 1 else 0 end) )), (sum( (case when( (chps.flg_f_bet OR chps.cnt_f_call > 0 OR chps.cnt_f_raise > 0 OR chps.flg_f_fold) AND chps.flg_showdown ) then 1 else 0 end) )), (sum( (case when( (chps.flg_f_bet OR chps.cnt_f_call > 0 OR chps.cnt_f_raise > 0 OR chps.flg_f_fold) AND chps.flg_showdown AND chps.flg_won_hand ) then 1 else 0 end) )), (sum((case when(chps.cnt_f_raise > 0) then 1 else 0 end))), (sum( (case when( chps.cnt_f_call > 0 AND chps.flg_showdown AND chps.flg_won_hand) then 1 else 0 end) )), (sum( (case when( chps.cnt_f_call > 0 AND chps.flg_showdown) then 1 else 0 end) )), (sum((case when(((chps.amt_f_bet_facing > 0 AND (lookup_actions_f.action SIMILAR TO '(R|XR)%')) OR chps.flg_f_3bet OR chps.flg_f_4bet) AND (chpc.flg_f_flush_draw OR chpc.flg_f_straight_draw) ) then 1 else 0 end)) ), (sum((case when((chps.amt_f_bet_facing > 0 OR chps.flg_f_3bet_opp OR chps.flg_f_4bet_opp) AND (chpc.flg_f_flush_draw OR chpc.flg_f_straight_draw) ) then 1 else 0 end))), (sum((case when(chps.cnt_f_raise > 0 ) then 1 else 0 end))), (sum((case when(chps.amt_f_bet_facing > 0 OR chps.flg_f_3bet_opp OR chps.flg_f_4bet_opp ) then 1 else 0 end))), (sum((case when(((chps.amt_f_bet_facing > 0 AND (lookup_actions_f.action SIMILAR TO '(R|XR)%')) OR chps.flg_f_3bet OR chps.flg_f_4bet) AND chpc.flg_f_straight_draw ) then 1 else 0 end)) ), (sum((case when((chps.amt_f_bet_facing > 0 OR chps.flg_f_3bet_opp OR chps.flg_f_4bet_opp) AND (chpc.flg_f_straight_draw) ) then 1 else 0 end))), (sum((case when(chps.cnt_f_raise > 0 AND chps.flg_showdown) then 1 else 0 end))), (sum((case when(chps.cnt_f_raise > 0 AND chps.flg_showdown AND chps.flg_won_hand) then 1 else 0 end))), (sum((case when(lookup_hole_cards.flg_pair = true AND chps.flg_f_saw =true) then 1 else 0 end))), (sum((case when(chps.flg_won_hand AND chps.flg_f_saw AND NOT chps.flg_showdown) then 1 else 0 end))), (sum((case when(chps.flg_won_hand AND chps.flg_f_saw AND chps.flg_showdown) then 1 else 0 end))), (sum((case when(lookup_hole_cards.flg_pair AND chps.flg_f_saw AND (chpc.flg_f_threeoak AND chpc.id_f_hand_strength >= 4)) then 1 else 0 end))), (sum((case when(chps.flg_p_3bet_def_opp AND chps.flg_p_first_raise AND chps.enum_p_3bet_action='F') then 1 else 0 end))), (sum((case when(chps.flg_p_3bet_def_opp AND chps.flg_p_first_raise AND chps.cnt_p_face_limpers=0 AND chps.enum_p_3bet_action='F') then 1 else 0 end))), (sum((case when(chps.flg_p_3bet_def_opp AND chps.flg_p_first_raise) then 1 else 0 end))), (sum((case when(chps.flg_p_3bet_def_opp AND chps.flg_p_first_raise AND chps.cnt_p_face_limpers=0) then 1 else 0 end))), (sum((case when((chps.position = 0) AND (chs.str_aggressors_p LIKE '81%' and chs.str_actors_p LIKE '1%') AND (chps.flg_p_3bet) AND (chps.flg_p_4bet_def_opp and chs.str_aggressors_p = '8101') AND (chps.enum_p_4bet_action = 'F')) then 1 else 0 end))), (sum((case when(char_length(chs.str_aggressors_p) >= 4 AND chps.flg_p_3bet AND chps.enum_p_4bet_action = 'F' AND ((chs.cnt_players >= 3 and (case when(char_length(chs.str_aggressors_p) < 4) then '-1' else (substring(chs.str_aggressors_p from 4 for 1)) end)::int < chps.position) OR (chs.cnt_players = 2 and (case when(char_length(chs.str_aggressors_p) < 4) then '-1' else (substring(chs.str_aggressors_p from 4 for 1)) end)::int > chps.position))) then 1 else 0 end))), (sum((case when(chps.flg_p_squeeze and chps.enum_p_4bet_action = 'F') then 1 else 0 end))), (sum((case when((chps.position = 0) AND (chs.str_aggressors_p LIKE '81%' and chs.str_actors_p LIKE '1%') AND (chps.flg_p_3bet) AND (chps.flg_p_4bet_def_opp and chs.str_aggressors_p = '8101')) then 1 else 0 end))), (sum((case when(char_length(chs.str_aggressors_p) >= 4 AND chps.flg_p_3bet AND chps.flg_p_4bet_def_opp AND ((chs.cnt_players >= 3 and (case when(char_length(chs.str_aggressors_p) < 4) then '-1' else (substring(chs.str_aggressors_p from 4 for 1)) end)::int < chps.position) OR (chs.cnt_players = 2 and (case when(char_length(chs.str_aggressors_p) < 4) then '-1' else (substring(chs.str_aggressors_p from 4 for 1)) end)::int > chps.position))) then 1 else 0 end))), (sum((case when(chps.flg_p_squeeze and chps.flg_p_4bet_def_opp) then 1 else 0 end))), (sum((case when(((NOT chps.flg_p_face_raise) OR (chps.flg_p_limp) OR (chps.flg_p_first_raise)) AND NOT (chps.flg_blind_b OR chps.flg_blind_db) AND ((chps.id_holecard) = 3 OR (chps.id_holecard) = 2)) then 1 else 0 end))), (sum((case when(chps.flg_r_bet AND chps.flg_showdown) then 1 else 0 end))), (sum((case when( (chps.flg_r_bet OR chps.cnt_r_raise > 0)) then 1 else 0 end))), (sum((case when(chps.flg_steal_att AND chps.flg_p_3bet_def_opp AND chps.enum_p_3bet_action='R') then 1 else 0 end))), (sum( (case when( (chps.flg_t_bet OR chps.cnt_t_call > 0 OR chps.cnt_t_raise > 0 OR chps.flg_t_fold) ) then 1 else 0 end) )), (sum( (case when( (chps.flg_t_bet OR chps.cnt_t_call > 0 OR chps.cnt_t_raise > 0 OR chps.flg_t_fold) AND chps.flg_showdown ) then 1 else 0 end) )), (sum( (case when( (chps.flg_t_bet OR chps.cnt_t_call > 0 OR chps.cnt_t_raise > 0 OR chps.flg_t_fold) AND chps.flg_showdown AND chps.flg_won_hand) then 1 else 0 end) )), (sum((case when( (chps.flg_t_bet OR chps.cnt_t_raise > 0)) then 1 else 0 end))), (sum((case when( chps.cnt_t_call > 0 AND chps.flg_showdown ) then 1 else 0 end) )), (sum((case when( chps.cnt_t_call > 0 AND chps.flg_showdown AND chps.flg_won_hand ) then 1 else 0 end) )), (sum( (case when((chps.flg_f_bet OR chps.cnt_f_raise > 0) and chps.flg_showdown) then 1 else 0 end))), (sum( (case when( chps.cnt_f_raise > 0 and chps.flg_showdown) then 1 else 0 end))), (sum( (case when((chps.flg_r_bet OR chps.cnt_r_raise > 0) and chps.flg_showdown) then 1 else 0 end))), (sum( (case when((chps.flg_t_bet OR chps.cnt_t_raise > 0) and chps.flg_showdown) then 1 else 0 end))), (sum( (case when( (chps.flg_f_bet OR chps.cnt_f_raise > 0) and chps.flg_won_hand and chps.flg_showdown) then 1 else 0 end))), (sum((case when(chps.flg_r_bet AND chps.flg_won_hand AND chps.flg_showdown) then 1 else 0 end))), (sum( (case when( (chps.flg_r_bet OR chps.cnt_r_raise > 0) and chps.flg_won_hand and chps.flg_showdown) then 1 else 0 end))), (sum( (case when( (chps.flg_t_bet OR chps.cnt_t_raise > 0) and chps.flg_won_hand and chps.flg_showdown) then 1 else 0 end))), (sum((case when(chps.flg_p_4bet AND chps.flg_p_first_raise) then 1 else 0 end))), (sum((case when(chps.flg_p_3bet_def_opp AND chps.flg_p_first_raise) then 1 else 0 end))) FROM (SELECT * FROM cash_hand_player_statistics WHERE id_hand > (SELECT CASE WHEN setting_value IS NULL THEN 0 ELSE setting_value::integer END FROM settings WHERE setting_name = 'cache_update:cash_custom')) as chps LEFT OUTER JOIN lookup_hole_cards ON chps.id_holecard=lookup_hole_cards.id_holecard AND chps.id_gametype=lookup_hole_cards.id_gametype LEFT OUTER JOIN (SELECT * FROM cash_hand_player_combinations WHERE id_hand > (SELECT CASE WHEN setting_value IS NULL THEN 0 ELSE setting_value::integer END FROM settings WHERE setting_name = 'cache_update:cash_custom')) as chpc ON (chps.id_hand = chpc.id_hand AND chps.id_player = chpc.id_player), (SELECT * FROM cash_hand_summary WHERE id_hand > (SELECT CASE WHEN setting_value IS NULL THEN 0 ELSE setting_value::integer END FROM settings WHERE setting_name = 'cache_update:cash_custom')) as chs, lookup_actions lookup_actions_f, lookup_positions WHERE (chs.id_hand = chps.id_hand AND chs.id_limit = chps.id_limit) AND (lookup_actions_f.id_action=chps.id_action_f) AND (lookup_positions."position"=chps."position" AND lookup_positions.cnt_players=chps.cnt_players_lookup_position) GROUP BY chps.id_player, chps.id_gametype, chps.id_limit, chs.cnt_players, ((case when( lookup_positions.flg_sb) then 0 else (case when( lookup_positions.flg_bb) then 1 else (case when( lookup_positions.flg_ep) then 2 else (case when( lookup_positions.flg_mp) then 3 else (case when( lookup_positions.flg_co) then 4 else 5 end) end) end) end) end)), (chps.flg_f_has_position), (chps.flg_t_has_position), (chps.flg_r_has_position), (CAST ( ((date_part('year', timezone('UTC', chps.date_played + INTERVAL '0 HOURS')) * 100) + (EXTRACT (WEEK FROM timezone('UTC', chps.date_played + INTERVAL '0 HOURS')))) AS integer )) CONTEXT: PL/pgSQL function update_cash_custom_cache() line 9 at FOR over SELECT rows )

How to fix it?

Re: Error when importing hands

PostPosted: Wed Dec 15, 2021 7:21 am
by Flag_Hippo
You have an issue with a custom statistic that is referencing something that does not exist in the database:

Vladislav1975 wrote:ERROR: column lookup_hole_cards.flg_pair does not exist

If you cannot identify the specific custom column/statistic causing that error so you can delete/fix it then open a Support Ticket with a copy of this file attached and your full log file:

C:\Users\{Windows Login}\AppData\Local\PokerTracker 4\Data\StatDefinitionsCustomized.pt4

Guide: How to Create & Submit a PokerTracker4.log File