xhgui icon indicating copy to clipboard operation
xhgui copied to clipboard

Fix PostgreSQL column name case sensitivity in WHERE clauses

Open wazum opened this issue 3 months ago • 0 comments

PostgreSQL treats unquoted identifiers as lowercase, but the xhgui schema creates columns with specific case (e.g., SERVER in uppercase). This causes SQL errors when filtering results:

  SQLSTATE[42703]: Undefined column: column "server" does not exist

This commit quotes all column names in WHERE clauses to preserve their case, ensuring PostgreSQL uses the exact column names as defined in the schema. The fix is compatible with both PostgreSQL and MySQL databases (relies on the already set SQL_MODE=ANSI_QUOTES).

Affected columns:

  • simple_url
  • request_date
  • request_ts
  • SERVER (for remote_addr, cookie, and server_name filters)

Fixes the "Slim Application Error" when viewing traces in xhgui with PostgreSQL backends.

Resolves #573

wazum avatar Sep 17 '25 04:09 wazum