public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Steve Midgley <[email protected]>
Cc: Bo Guo <[email protected]>
Cc: Greg Sabino Mullane <[email protected]>
Cc: pgsql-sql <[email protected]>
Subject: Re: Overcoming Initcap Function limitations?
Date: Mon, 04 Dec 2023 23:23:55 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJexoSLZKvxVBoueN0_YjTkSu4-G1A1wFbPCqw_9S4b+cs9NXA@mail.gmail.com>
References: <CADHFRch1=ND1TpiOidJELBdJJSugn-H1d3vyjg9gh9Nw1dZCgg@mail.gmail.com>
	<CAKAnmmKhepxPzLWiU2JMNWsNiwLmQAyKCgV-f2dMot1hKVa-hA@mail.gmail.com>
	<CAJexoSK3grH+4khLYMDH=dBwbZxx=F-5GUM1rzHh5fzT_GGuwg@mail.gmail.com>
	<CADHFRcj_4uaxjNSJCCmB8LBE3w5BHh8a7u3pMpZiyDQSbawTyA@mail.gmail.com>
	<CAJexoSLZKvxVBoueN0_YjTkSu4-G1A1wFbPCqw_9S4b+cs9NXA@mail.gmail.com>

Steve Midgley <[email protected]> writes:
> On Mon, Dec 4, 2023, 5:39 PM Bo Guo <[email protected]> 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





view thread (7+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Overcoming Initcap Function limitations?
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox