After I had the same error in my previous DB, I decided to create a new one.
I tried to re-import the whole ipoker folder from my processed HHs.
First 70k hands were imported smoothly, however this error appeared after:
01:15:13 am: Import file: C:\Users\BOUZILLATOR\AppData\Local\PokerTracker 4\Processed\iPoker\2017\08-27\4126861270.xml
01:15:14 am: Error: iPoker: Unable to import hand. Reason: Error: Unable to execute query: Fatal Error; Reason: Error: (ERROR: division by zero CONTEXT: PL/pgSQL function update_tourney_custom_cache() line 9 at FOR over SELECT rows )
01:15:14 am: + Complete (3 hands, 0 summaries, 1 error, 0 duplicates)
01:15:14 am: Import file: C:\Users\BOUZILLATOR\AppData\Local\PokerTracker 4\Processed\iPoker\2017\08-27\4127649043.xml
01:15:14 am: Error: iPoker: Unable to import hand. Reason: Error: Unable to execute query: Fatal Error; Reason: Error: (ERROR: division by zero CONTEXT: PL/pgSQL function update_tourney_custom_cache() line 9 at FOR over SELECT rows )
01:15:14 am: + Complete (1 hand, 0 summaries, 1 error, 0 duplicates)
01:15:14 am: Import file: C:\Users\BOUZILLATOR\AppData\Local\PokerTracker 4\Processed\iPoker\2017\08-27\4127649056.xml
01:15:14 am: Error: iPoker: Unable to import hand. Reason: Error: Unable to execute query: Fatal Error; Reason: Error: (ERROR: division by zero CONTEXT: PL/pgSQL function update_tourney_custom_cache() line 9 at FOR over SELECT rows )
01:15:14 am: + Complete (1 hand, 0 summaries, 1 error, 0 duplicates)
01:15:14 am: Import file: C:\Users\BOUZILLATOR\AppData\Local\PokerTracker 4\Processed\iPoker\2017\08-27\4127649065.xml
01:15:14 am: Error: iPoker: Unable to import hand. Reason: Error: Unable to execute query: Fatal Error; Reason: Error: (ERROR: division by zero CONTEXT: PL/pgSQL function update_tourney_custom_cache() line 9 at FOR over SELECT rows )
01:15:14 am: + Complete (1 hand, 0 summaries, 1 error, 0 duplicates)
01:15:14 am: Import file: C:\Users\BOUZILLATOR\AppData\Local\PokerTracker 4\Processed\iPoker\2017\08-27\4127782603.xml
01:15:14 am: Error: iPoker: Unable to import hand. Reason: Error: Unable to execute query: Fatal Error; Reason: Error: (ERROR: division by zero CONTEXT: PL/pgSQL function update_tourney_custom_cache() line 9 at FOR over SELECT rows )
01:15:14 am: + Complete (36 hands, 0 summaries, 1 error, 0 duplicates)
01:15:14 am: Import file: C:\Users\BOUZILLATOR\AppData\Local\PokerTracker 4\Processed\iPoker\2017\08-27\4127782605.xml
01:15:15 am: Error: iPoker: Unable to import hand. Reason: Error: Unable to execute query: Fatal Error; Reason: Error: (ERROR: division by zero CONTEXT: PL/pgSQL function update_tourney_custom_cache() line 9 at FOR over SELECT rows )
01:15:15 am: + Complete (23 hands, 0 summaries, 1 error, 0 duplicates)
Same for all the files that followed. New HHs generate errors too.
What should I do? thanks