Re: Overcoming Initcap Function limitations? - Mailing list pgsql-sql

From Tom Lane
Subject Re: Overcoming Initcap Function limitations?
Date
Msg-id 848536.1701750235@sss.pgh.pa.us
Whole thread Raw
In response to Re: Overcoming Initcap Function limitations?  (Steve Midgley <science@misuse.org>)
Responses Re: Overcoming Initcap Function limitations?
List pgsql-sql
Steve Midgley <science@misuse.org> writes:
> On Mon, Dec 4, 2023, 5:39 PM Bo Guo <bo.guo@gisticinc.com> wrote:
>> Your suggestions open up new potentials for me to explore.  At this
>> moment, I lean towards normalizing the database column values in upper
>> case, thereby out-sourcing the case-changing responsibility to the front
>> end.  I would love to hear from your thoughts on this pattern.

> It really depends on the use case. If your users are happy with all
> uppercase, that seems like a great solution: fast, cheap, and reliable!

FWIW, as an old database geek I'd lean more towards "store the original
input data".  If you are expecting the client-side display code to
transform the casing anyway, I don't see any advantage in smashing to
upper case beforehand.  And keeping the original casing could have
value down the road, if only for forensic purposes.

            regards, tom lane



pgsql-sql by date:

Previous
From: Steve Midgley
Date:
Subject: Re: Overcoming Initcap Function limitations?
Next
From: Greg Sabino Mullane
Date:
Subject: Re: Overcoming Initcap Function limitations?