Skip to content

Conversation

@wazum
Copy link

@wazum wazum commented Sep 17, 2025

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

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.

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 perftools#573
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostgreSQL compatibility: Quote column names in WHERE clauses

2 participants