SQL UPPER and LOWER Functions Not Working in Retool

Hi Retool Community,

I'm encountering an issue with the UPPER and LOWER SQL functions in Retool. Despite following the standard SQL syntax, these functions do not seem to work as expected. Here are the details:

Goal: I am trying to transform text in my database queries using the UPPER and LOWER SQL functions. The expected behavior is for the UPPER function to convert text to uppercase and the LOWER function to convert text to lowercase.

Steps: So far, I've tried writing simple SQL queries in the Retool query editor. The queries work correctly in my database's native query editor, but not in Retool. Here is an example of the SQL code I am using:

SELECT
    flight_number,
    UPPER(status) AS status_upper,
    LOWER(pilot_name) AS pilot_name_lower
FROM flights

I have consulted the Retool documentation on writing SQL queries and verified that my database connection settings are correct. However, the transformed text does not reflect in the Retool query results.

Details: Below is the relevant code snippet:

SELECT
    flight_number,
    UPPER(status) AS status_upper,
    LOWER(pilot_name) AS pilot_name_lower
FROM flights

Instead of converting the status column to uppercase and the pilot_name column to lowercase, the columns return the original values without any change in case. There are no error messages, just no transformation applied.

Screenshot:

Can you add a COLLATE step into your query to cast the source data properly? It seems like this is a limitation of the current PostgreSQL DB settings to not be properly handling Cyrillic.

Cyrillic_General_CI_AS

Seems to be the default for Russian, but there are other Cyrillic sets out there as well.

1 Like