Frappe PostgreSQL UUID Error

Why does Frappe encounter issues when comparing Text and UUID fields while using PostgreSQL?

I have a Doctype with naming set to UUID and the Title field enabled. However, when linking this Doctype to another and displaying it, I encounter the following error:

App Versions

{
	"frappe": "16.0.0-dev",
	"custom_app": "0.0.1"
}

Route

List/Consumer/List

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 116, in application
    response = frappe.api.handle(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 51, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 84, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1520, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 32, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 689, in wrapper_fn
    retval = fn(*args, **get_newargs(fn, kwargs))
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/desk/reportview.py", line 34, in get
    data = compress(execute(**args), args=args)
                    ^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/desk/reportview.py", line 97, in execute
    return DatabaseQuery(doctype).execute(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/db_query.py", line 209, in execute
    result = self.build_and_run()
             ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/db_query.py", line 250, in build_and_run
    return frappe.db.sql(
           ^^^^^^^^^^^^^^
  File "apps/frappe/frappe/database/postgres/database.py", line 233, in sql
    return super().sql(modify_query(query), modify_values(values), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/database/database.py", line 255, in sql
    self._cursor.execute(query, values)
psycopg2.errors.UndefinedFunction: operator does not exist: uuid = character varying
LINE 2: ...tabRegion" "tabRegion_1" on ("tabRegion_1"."name" = "tabCons...
                                                             ^
HINT:  No operator matches the given name and argument types. You might need to add explicit type casts.


Request Data

{
	"type": "POST",
	"args": {
		"doctype": "Consumer",
		"fields": "[\"`tabConsumer`.`name`\",\"`tabConsumer`.`owner`\",\"`tabConsumer`.`creation`\",\"`tabConsumer`.`modified`\",\"`tabConsumer`.`modified_by`\",\"`tabConsumer`.`_user_tags`\",\"`tabConsumer`.`_comments`\",\"`tabConsumer`.`_assign`\",\"`tabConsumer`.`_liked_by`\",\"`tabConsumer`.`docstatus`\",\"`tabConsumer`.`idx`\",\"`tabConsumer`.`consumer_name`\",\"`tabConsumer`.`register_date`\",\"`tabConsumer`.`region`\",\"region.region_name as region_region_name\"]",
		"filters": "[]",
		"order_by": "`tabConsumer`.creation desc",
		"start": 0,
		"page_length": 20,
		"view": "List",
		"group_by": null,
		"with_comment_count": 1
	},
	"freeze": false,
	"freeze_message": "Loading...",
	"headers": {},
	"error_handlers": {},
	"url": "/api/method/frappe.desk.reportview.get",
	"request_id": null
}

Response Data

{
	"exception": "",
	"exc_type": "UndefinedFunction",
	"_debug_messages": "[\"Error in query:\\noperator does not exist: uuid = character varying\\nLINE 2: ...tabRegion\\\" \\\"tabRegion_1\\\" on (\\\"tabRegion_1\\\".\\\"name\\\" = \\\"tabCons...\\n                                                             ^\\nHINT:  No operator matches the given name and argument types. You might need to add explicit type casts.\\n\"]"
}

What could be causing this issue, and how can I resolve it?