original pgbadger from darol as of commit 506
fc98539dba89708b7e88326e379d7b4335147e58