Re: UPPER() Function Not Working as Expected in PostgreSQL 12.5 Version - Mailing list pgsql-sql

From David G. Johnston
Subject Re: UPPER() Function Not Working as Expected in PostgreSQL 12.5 Version
Date
Msg-id CAKFQuwb_dLFQ_K6n8RjjV32DmBkad7+RUqLBC1W9ZyHCNHYkAA@mail.gmail.com
Whole thread Raw
In response to UPPER() Function Not Working as Expected in PostgreSQL 12.5 Version  ("Saraswat, Dhruv" <dhruv.saraswat@thermofisher.com>)
Responses Re: UPPER() Function Not Working as Expected in PostgreSQL 12.5 Version  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
On Thu, Jul 8, 2021 at 2:26 AM Saraswat, Dhruv <dhruv.saraswat@thermofisher.com> wrote:

Long Version –

We have a table in which 1 of the columns is called ‘name’ with a datatype of ‘name’. This column stores username values, for example ==> dhruv.saraswat@thermofisher.com


I unfortunately don't know the answer to your primary query but you are definitely misusing the "name" datatype.  An email address should be stored using text.  In fact, per the documentation, user schemas should not use the "name" type for any reason.

In furtherance of diagnosing the observed problem, though, showing the explain analyze plans from the two systems would be helpful - mostly in trying to figure out whether indexes use is a differentiating factor.  Being able to get rid of the table altogether would be a nice bonus - construct cases with working and non-working values (lower and upper results) looking for observed differences.

In short, though, while their may be a bug here, and we'd like to know, the suggested course of action for you is to fix your schema to use the documented text data type and get rid of the effectively undocumented "name".

David J.

pgsql-sql by date:

Previous
From: "Saraswat, Dhruv"
Date:
Subject: UPPER() Function Not Working as Expected in PostgreSQL 12.5 Version
Next
From: Tom Lane
Date:
Subject: Re: UPPER() Function Not Working as Expected in PostgreSQL 12.5 Version