Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4vxj-00073t-Na for pgsql-general@arkaria.postgresql.org; Fri, 15 Mar 2019 23:10:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h4vxh-0000iI-BH for pgsql-general@arkaria.postgresql.org; Fri, 15 Mar 2019 23:10:01 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4vxg-0000i1-VX for pgsql-general@lists.postgresql.org; Fri, 15 Mar 2019 23:10:01 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h4vxa-000659-9e for pgsql-general@postgresql.org; Fri, 15 Mar 2019 23:10:00 +0000 Received: by mail-pf1-x42c.google.com with SMTP id v21so7313745pfm.12 for ; Fri, 15 Mar 2019 16:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=KY6RLg2reRIT/ETcqIVv2pHO44784OSSueQ1EOx/tF4=; b=cMOFPB8O71QDrgajLqJJ0agdRMrFVGVqcxA4aQgtO+NH48hoNjmPp7n2bEwnUqdw/D NzCdJ6c/Q/mbviBFYuT89NyXUp9Em6vsAmrzSX9tsFdQNu9LzkXTZoJtzjn8eDo7S5f8 lm+jwUaewuodSkdGdgRZmBVXl+36sI8azENRMnw7+jm7x8u2NnuUih5PLlcKx+YzaKUI aJA4I1gtncBhPrPaGfY4rTD0T5THai0inKBcKctkjiaxa7cthfpiy8K4ZPBK04mdG6Tz tScIq3RKDKPqdpNhPN+CtmaY59WBlwgU6SnuJGfiScPZXRRSTuzQ2jR8KzskM9AYnVrf 97Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=KY6RLg2reRIT/ETcqIVv2pHO44784OSSueQ1EOx/tF4=; b=MaphlcXeBKhs7lwPDF3AMBbU+ANBMGeLWxf0ldz2w8G41xhIls7BqDlNxN8deYwJQJ Xu1AtTbkEIcNaziKZzWUTJJNThTwaSj5UmlYONbWxd6ws4OMiVmo5VcGNWKkeTQmMVWl 8d1FuryMUJXF2UT2UOBYA9kB6u885BnaZEY+0xSxHtizuv16Ai5BUmzdBYJaOluv7tDk OnNIL1lxNl90DMRfJzjtDrZ57p9C7ldMGCLk8vuuyJaD2RO779QOI+w99wvhhrn52+J9 jO6aeqCx6WzJ5k6EE0MDPiMGmcJvdzGQRvBB78ip7oq/ckT4Vxv6vxXpB/AkzFfpUUId 8sKw== X-Gm-Message-State: APjAAAWAoLRGFRvhc6+HgvQkTNkXWVdPEmAlXwqpKvCDV5E+VuQWgK+V UZ0gAAN/Cq5lWOWez9WW3Wc= X-Google-Smtp-Source: APXvYqySxi1powqQlOFYwB/tRoKg/ymPVuHethFI6wK2iwDCudZpB/Ux1nkr39ASHXWwlpjZRxV8QA== X-Received: by 2002:a63:d542:: with SMTP id v2mr5922525pgi.52.1552691391157; Fri, 15 Mar 2019 16:09:51 -0700 (PDT) Received: from kitselas.hci.utah.edu ([155.100.47.6]) by smtp.gmail.com with ESMTPSA id 14sm6561055pft.137.2019.03.15.16.09.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Mar 2019 16:09:50 -0700 (PDT) From: Rob Sargent Message-Id: <7D62A9A2-C784-47A9-96BC-5949D0C8348E@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_2CD3CE13-9C3B-4609-AF8B-DFE1D3D7CF42" Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: Camel case identifiers and folding Date: Fri, 15 Mar 2019 17:09:49 -0600 In-Reply-To: Cc: wim.bertels@ucll.be, Steve Haresnape , "pgsql-general@postgresql.org" To: Morris de Oryx References: <1552641160.5846.2.camel@ucll.be> X-Mailer: Apple Mail (2.3445.102.3) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail=_2CD3CE13-9C3B-4609-AF8B-DFE1D3D7CF42 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Mar 15, 2019, at 4:43 PM, Morris de Oryx = wrote: >=20 > 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: >=20 > Never >=20 > Now here's the list of times I would like a case-blind text field: >=20 > Everywhere else. >=20 > 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. >=20 > If you have JSON, which has case-sensitive element names, use JSONB.=20= >=20 > 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. >=20 > 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. >=20 >=20 >=20 What sort of content is in your field of type text? Certainly, in = English prose, =E2=80=9Crob=E2=80=9D is different than =E2=80=9CRob=E2=80=9D= and if the content is for a web page (or in my experience, the content = of medical reference books) these differences are critical.= --Apple-Mail=_2CD3CE13-9C3B-4609-AF8B-DFE1D3D7CF42 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

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, =E2=80=9Crob=E2=80=9D is = different than =E2=80=9CRob=E2=80=9D and if the content is for a web = page (or in my experience, the content of medical reference books) these = differences are critical.= --Apple-Mail=_2CD3CE13-9C3B-4609-AF8B-DFE1D3D7CF42--