pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Sargent <robjsargent@gmail.com>
To: Morris de Oryx <morrisdeoryx@gmail.com>
Cc: wim.bertels@ucll.be
Cc: Steve Haresnape <s.haresnape@creativeintegrity.co.nz>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Camel case identifiers and folding
Date: Fri, 15 Mar 2019 17:09:49 -0600
Message-ID: <7D62A9A2-C784-47A9-96BC-5949D0C8348E@gmail.com> (raw)
In-Reply-To: <CAKqnccin-0hXKM8q527kvSG=pOGrqUZy2VHsZd4-dWOc29nG=w@mail.gmail.com>
References: <CAJrKPxc69dMNJAE=3Y5mG56sXwQLRqXZnN4inZQ3EXdwZFqH2Q@mail.gmail.com>
	<1552641160.5846.2.camel@ucll.be>
	<CAKqnccin-0hXKM8q527kvSG=pOGrqUZy2VHsZd4-dWOc29nG=w@mail.gmail.com>



> On Mar 15, 2019, at 4:43 PM, Morris de Oryx <morrisdeoryx@gmail.com> wrote:
> 
> The original question has already been answered really well, but it reminds me to mention that Postgres text/varchar values are case-sensitive. Here's a list of the times when I would like a case-sensitive text field:
> 
>    Never
> 
> Now here's the list of times I would like a case-blind text field:
> 
>    Everywhere else.
> 
> If this is how you feel too, there are several alternatives. The one that I've chosen is to use the citext extension instead of text fields.This takes care of the problem without having to add extra function calls to your queries, do anything special with indexes, etc.
> 
>  If you have JSON, which has case-sensitive element names, use JSONB. 
> 
> Your requirements may differ than mine! Other people have good reason to want case-sensitive searches. I just never do. (30+ years in programming and I can't remember a time I wanted user data to be treated case-sensitively...but you never know...one day...maybe.) There's also an extension for stripping accents, which I've not needed.
> 
> I've idly wondered if using a different collation on a text field might be a better answer than using citext everywhere? If anyone wants to set me straight on this, I'd be grateful.
> 
> 
> 
What sort of content is in your field of type text?  Certainly, in English prose, “rob” is different than “Rob” and if the content is for a web page (or in my experience, the content of medical reference books) these differences are critical.=

view thread (20+ messages)  latest in thread

Message-ID: <7D62A9A2-C784-47A9-96BC-5949D0C8348E@gmail.com>
Permalink:  ../7D62A9A2-C784-47A9-96BC-5949D0C8348E@gmail.com/
Also on:    postgresql.org/message-id/7D62A9A2-C784-47A9-96BC-5949D0C8348E@gmail.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: robjsargent@gmail.com, morrisdeoryx@gmail.com, wim.bertels@ucll.be, s.haresnape@creativeintegrity.co.nz
  Subject: Re: Camel case identifiers and folding
  In-Reply-To: <7D62A9A2-C784-47A9-96BC-5949D0C8348E@gmail.com>
  References: <CAJrKPxc69dMNJAE=3Y5mG56sXwQLRqXZnN4inZQ3EXdwZFqH2Q@mail.gmail.com> <1552641160.5846.2.camel@ucll.be> <CAKqnccin-0hXKM8q527kvSG=pOGrqUZy2VHsZd4-dWOc29nG=w@mail.gmail.com> <7D62A9A2-C784-47A9-96BC-5949D0C8348E@gmail.com>

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

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