darold / pgbadger

A fast PostgreSQL Log Analyzer
http://pgbadger.darold.net/
PostgreSQL License
3.45k stars 348 forks source link

Page crashes when application name has "<some text>" #783

Closed fabiogeiss closed 11 months ago

fabiogeiss commented 1 year ago

For a long time I had problems seeing the report. When I tried to access any statistics, such as "top time comsuming queries", the page would break. So I decided to open the browser's development console and it showed an error in specific positions of two lines. I then realized that the broken data was the application_name and that it contained some peculiar information. The DBeaver client set the value to be: "app + version + a text between '<>' " . Something like: "DBeaver 12.3.7 \". I edited the index.html removing the value "" and the page reopened.

Steps to simulate the problem:


1 - Connect to database
2 - set application_name = 'test <some script.sql>';
3 - set log_min_duration_statement= '1s';
4 - select pg_sleep(2);
5 - generate pgBadger report;
6 - try to open a statistic page;
darold commented 11 months ago

Commit 853eedf fixes this issue.