Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSHvt-005k7O-Kr for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jun 2025 16:16:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uSHvq-00ChVW-8c for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jun 2025 16:16:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uSHvp-00ChVM-Qx for pgsql-hackers@lists.postgresql.org; Thu, 19 Jun 2025 16:16:06 +0000 Received: from mail-vs1-xe36.google.com ([2607:f8b0:4864:20::e36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uSHvm-002yXV-2I for pgsql-hackers@postgresql.org; Thu, 19 Jun 2025 16:16:06 +0000 Received: by mail-vs1-xe36.google.com with SMTP id ada2fe7eead31-4e7f367ea11so291713137.3 for ; Thu, 19 Jun 2025 09:16:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xzilla-net.20230601.gappssmtp.com; s=20230601; t=1750349760; x=1750954560; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eP49xGJ15oHQrmEEZBGppftxpibOn+uwTILvnbtQsRE=; b=QgkPEkOhh7j+/3WZaHuRTLPnJdmx+LAc0ulJm1ev+utqo1WKhfMs59zP/zNk+O+a0F TU0b1Ow/WKgbF20hSKfmSHCG22oMy61YqPJexBpErwFd2COV9WDhXcTSB4kzI5fHVuP4 a5RxatQpZcxOXrir9fV/NMzMFS54epxIWjW3C34nNvwiE5qLZ+6W4Y9Mdx4zKM31iyHg mXseKXLfc5SEUzx5/CvIrx/hw3KCSwvXjioFG3BMatho3MF7DWdLVga58R6VJw+kaLu9 pjVttstvz+zoDWKJy09RSPO4/ZfqtOO88B/5KZyFXWqQwtJPTLz4tYN+fhmYXxnSuT6g TsAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750349760; x=1750954560; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eP49xGJ15oHQrmEEZBGppftxpibOn+uwTILvnbtQsRE=; b=Mpbxn9gknAHxddC4Kf20qYUNZVMgDUZDIaLZBjk338yHWdnmopxSbLxJ75OMimsK18 EqW9H1HDlLWHyb5NZ9UZfgUsEQSevR+809LIRqyP+LK/06lWdGc+YFudgwkOPa3SzUtM /p2JQAeWZFsw3/IvG1QUZruClKIM6tnqZfm4idXxtE4OATfJjpPeMYF2lmjh9xy4qFN3 COcV9NH+l0bTbFzfy+x5VGztx2S7wJKsnuie9nsgQwg9MqiHqW6F1vyxmi1LhRne39ZQ zOnUl3eD0gZWxBOu3senXt7WnLznpFuGmZymuUV3V5zS7vtVhaJsTw7CzBqqhswODycn TTsw== X-Forwarded-Encrypted: i=1; AJvYcCX3r0kMobmwbVp1SPTrbDPpaMUMDWuMOCiY6mJN1w6RoGc4IK6evJzU98/S5i8c6+nRMQzweT7sIa6lZbtE@postgresql.org X-Gm-Message-State: AOJu0YyYtK7+drnlKyzQEYc1NyRJAZ3iTuwGHw0qcF+Xf4jp97ixYdeO PDSMqvPz3ujdcTWuZWQUS+4x1zi3jsqBVxQeLvuZVNU0Qgl6m3XaH87UKStV9VAKSnjOmFQFgDj gPNAiWC2RyXrbxy7xOuRlaW+Z0rFEUmvsMK3ff1cAJw== X-Gm-Gg: ASbGncsbJpgyUe5ZmFTvfRUT6qQ8TkE1itFRXNuE5y1nQKnEezAp/GyqdDL8Qouexqy SJPnYoM2CxKog2+GMa8WM9Wha+JfHoVSAZyOgHN9z7LiCMqz27KI6ODQDHezaoWb4bmPkvzvI/T /BGxsyGn1x1uhXZuLTYdwEr89pURbCctgWfWxmd3iTHjA= X-Google-Smtp-Source: AGHT+IGvuTtSjCUJgm6RpfnC4g/PrgBU4rt5hJj9/lQW08QfViATP0m3Vmk91TFb/zP4Uxn+kMJZG3J+9c4VZ43EBtM= X-Received: by 2002:a05:6102:418d:b0:4dd:b82d:e0de with SMTP id ada2fe7eead31-4e7f6223165mr16478861137.17.1750349760624; Thu, 19 Jun 2025 09:16:00 -0700 (PDT) MIME-Version: 1.0 References: <47716a78-eb0b-4728-8991-fc0d958a01c9@joeconway.com> <36f69fa9-db3f-44a1-8c8a-95ff09704a9c@postgresfriends.org> <692d28a2-d5f8-4db5-a3ad-c7db9bab522f@postgresfriends.org> In-Reply-To: From: Robert Treat Date: Thu, 19 Jun 2025 12:15:48 -0400 X-Gm-Features: Ac12FXynxnHq5KYpO9GhkNyPXYEsrqysVZzGqXAlmU1kHBjf6xRMGdxTV2na7jQ Message-ID: Subject: Re: Add CASEFOLD() function. To: Thom Brown Cc: Peter Eisentraut , Jeff Davis , Vik Fearing , Joe Conway , Ian Lawrence Barwick , PostgreSQL-development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jun 19, 2025 at 11:37=E2=80=AFAM Thom Brown wrote: > On Thu, 19 Jun 2025 at 15:51, Peter Eisentraut wro= te: > > On 19.06.25 06:03, Thom Brown wrote: > > > Late to the party, but is there an argument for porting this to the > > > citext type? Or supplementing the extension with an additional type > > > ("cftext"? *shrug*). It currently uses lower(), so our current > > > recommendation for dealing with all unicode characters is to use > > > nondeterministic collations. > > > > What is the motivation for wanting a citext variant instead of using > > nondeterministic collations? > > Ease of use, perhaps. It seems easier to use: > > column_name cftext > > rather than: > > CREATE COLLATION case_insensitive_collation ( > PROVIDER =3D icu, > LOCALE =3D 'und-u-ks-level2', > DETERMINISTIC =3D FALSE > ); > > column_name text COLLATE case_insensitive_collation > > But I see the arguments against it. It creates an unnecessary > dependency on an extension, and if someone wants to ignore both case > and accents, they may resort to using 2 extensions (citext + unaccent) > when none are needed. I guess I don't feel strongly about it either > way. Don't forget, if you have a defined insensitive / normalized collations, you also enable on-the-fly collation based matching, a la "SELECT '=C3=85' =3D 'A' COLLATE ignore_accent_case;" regardless of the provided collations (which I think is much more common certain in other databases) Robert Treat https://xzilla.net