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 1rNKdh-00B5GL-Of for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2024 22:32:06 +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 1rNKdg-00GAJl-SC for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2024 22:32:04 +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 1rNKdg-00GAJd-FF for pgsql-hackers@lists.postgresql.org; Tue, 09 Jan 2024 22:32:04 +0000 Received: from mail-yw1-x1135.google.com ([2607:f8b0:4864:20::1135]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rNKdd-000ipL-Tz for pgsql-hackers@postgresql.org; Tue, 09 Jan 2024 22:32:03 +0000 Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-5f68af028afso27375517b3.2 for ; Tue, 09 Jan 2024 14:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1704839520; x=1705444320; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=NZVHPjMa5mY0Fl1WMhmQrdQqIA2FHnQY8fyDUgILNqY=; b=3C7d4mPpUFQt7Tc9c+YY4GLZ4Gcf9L5faN6l9IT33tvFe/vH2hhf2Xun6CeUkzPENz XbuNDIU9uk8XjhzGYAKwNctQshQzAq5hDy05yurHyuUv82OIbiD0n058kQBC/PaHSvwP ybSIcdiWWL4ha5TV9Rm37XbK1YvSfGndAj98cxcfzu7Wiqs0V+0UIymungmtoDcNi++V mmp0FBJEw+Iqy8laiEOjqhldhoveAeNEYQ/PnVmzxw4TrLn1J7YcPgns53GtFfDLbnR5 gFbvzxlGux6O9JmFBMCP8qyskMWEcGUbuksf5D30VtLVizap6pdpVFg+EYXamXe0HOX2 asLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704839520; x=1705444320; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=NZVHPjMa5mY0Fl1WMhmQrdQqIA2FHnQY8fyDUgILNqY=; b=cS6jGQH5sAeywjwgsQJDoqCmRIhZECC50jqRVL86viKBtCcZHmuB78+mbzQk72MW49 sKCjnE50g8LsEQb5CcbqoYF0qJ9p68Jlma7N/DADbQaYoT1s5wzqhBFPXRdOUGunwmUI h5n2wRKKA7HjZX4WBfT54v1ZCn80Dn0styWP3HozTiPa3mKpZm1mAol6jVEIip9j4rVD itu8sKlMPMHeUYdnYOraBFS7Fe9FcHqWNi56/ux50mSAHpHVc2PXw99YjVuntu2wFuEK 6i1R3F4Kfk/h0b2/fuUDLPjFq9pGKbmUtzpDVvSOXoJKHweM7ewRAZoUvciO+mMqe4SD PRsA== X-Gm-Message-State: AOJu0Ywoytw6bq1Gcy1ze9fzdvklREhF9JyTaXq3SY3DDqD9YNdZH2DR eQvXfwaxkYCLq6dL6LL0w0cH/U8Bn55t X-Google-Smtp-Source: AGHT+IFo7ZAozTNSH00Aey0xKHXb0FbCTb0o0eMwUL7TprGPWRS2ih7vDgs2dNpZHWT+aZt3qB70Ew== X-Received: by 2002:a0d:e8c3:0:b0:5d9:7528:e3a7 with SMTP id r186-20020a0de8c3000000b005d97528e3a7mr154061ywe.84.1704839519711; Tue, 09 Jan 2024 14:31:59 -0800 (PST) Received: from [10.21.17.221] ([139.104.3.93]) by smtp.gmail.com with ESMTPSA id v187-20020a0dd3c4000000b005de8c10f283sm1064461ywd.102.2024.01.09.14.31.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 14:31:59 -0800 (PST) Message-ID: Subject: Re: Built-in CTYPE provider From: Jeff Davis To: Jeremy Schneider , Daniel Verite Cc: Robert Haas , pgsql-hackers@postgresql.org Date: Tue, 09 Jan 2024 14:31:59 -0800 In-Reply-To: <2b98e5d9-6c51-41cf-8017-88a6a6a129bc@ardentperf.com> References: <6b1370d5eaba5e8c42f54c05f7bc2b8e27b8db12.camel@j-davis.com> <804eb67b37f41d3afeb2b6469cbe8bfa79c562cc.camel@j-davis.com> <2b98e5d9-6c51-41cf-8017-88a6a6a129bc@ardentperf.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2024-01-09 at 14:17 -0800, Jeremy Schneider wrote: > I think we missed something in psql, pretty sure I applied all the > patches but I see this error: >=20 > =3D# \l > ERROR:=C2=A0 42703: column d.datlocale does not exist > LINE 8:=C2=A0=C2=A0 d.datlocale as "Locale", >=20 Thank you. I'll fix this in the next patch set. > This is interesting. Jeff your original email didn't explicitly show > any > other initcap() results, but on Ubuntu 22.04 (glibc 2.35) I see > different results: >=20 > =3D# SELECT initcap('axxE =C3=A1xx=C3=89 =C7=84xx=C7=84 =C7=85xxx =C7=86x= xx'); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 initcap > -------------------------- > =C2=A0Axxe =C3=81xx=C3=A9 =C7=84xx=C7=86 =C7=84xxx =C7=84xxx >=20 > =3D# SELECT initcap('axxE =C3=A1xx=C3=89 =C7=84xx=C7=84 =C7=85xxx =C7=86x= xx' COLLATE C_UTF8); > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 initcap > -------------------------- > =C2=A0Axxe =C3=81xx=C3=A9 =C7=85xx=C7=86 =C7=85xxx =C7=85xxx The reason for this difference is because libc doesn't support titlecase. In the next patch set, I'll not use titlecase (only uppercase/lowercase even for initcap()), and then it will match libc 100%. > The COLLATE sql syntax feels awkward to me. In this example, we're > just > using it to attach locale info to the string, and there's not > actually > any collation involved here. Not sure if COLLATE comes from the > standard, and even if it does I'm not sure whether the standard had > upper/lowercase in mind. The standard doesn't use the COLLATE clause for case mapping, but also doesn't offer any other mechanism to, e.g., get case mapping according to the "tr_TR" locale. I think what Postgres does here, re-purposing the COLLATE clause to allow tailoring of case mapping, is imperfect but reasonable. My proposal doesn't change that. Regards, Jeff Davis