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 1rNL0k-00B8DC-HW for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2024 22:55:55 +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 1rNL0i-00GHNS-Uv for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Jan 2024 22:55:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNL0i-00GHNJ-LE for pgsql-hackers@lists.postgresql.org; Tue, 09 Jan 2024 22:55:52 +0000 Received: from mail-yw1-x112c.google.com ([2607:f8b0:4864:20::112c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rNL0d-000j9s-2A for pgsql-hackers@postgresql.org; Tue, 09 Jan 2024 22:55:51 +0000 Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-5e811c5c1adso31734647b3.2 for ; Tue, 09 Jan 2024 14:55:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1704840946; x=1705445746; 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=e+yrMnnC143J+mpiFbsPaCAbSGinoET7h2tcA8VC/2w=; b=RwzADLQgDERaEaFC+g8Qgl//OBgNetYjtSJcLWBX4cU8cAzdjyJtcgUi1J1gQXnC86 CZrCR+/pOPPgU92mMQ8zK2zfIkrUwQGkmjxLauqQkBl9lPk2BqfWsqNgGt/fPgljcL1m +oZUlLogKixg9AjOTOcbFYTvcSHDdyRecUHwKTYVfiaWDZN/p3oKEAwOuLPXGPgQ4TdM vC1DzSGZeirniHqe7wLqkjS0vbfhjsem8v1nXr3O4GL+ZknEgvOmQP9A9+B94M0jrQY8 JAFuVorOwOkJ0FWurH6R2ypYiGCa57nLDYm3MFfqo96jNJoD+d2v7OzFUE7BtLiv841e 5nEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704840946; x=1705445746; 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=e+yrMnnC143J+mpiFbsPaCAbSGinoET7h2tcA8VC/2w=; b=PsOxY8yYc9dj0Lr4gYnOP7Ltxp5FVbw7jxoUsKUDWlM3M1jzwBkb80O2jqR3txV5x6 c3xPDuAygCSPqevGkxz7bQDnIF+5OlHz6+pnBcLFmNkhvn0M5mI10JAvz0B/X8xsLpMj J7Wtlp/t9d0QmV4mRB8guIFrw2aStLSzpjCgL3HrtUtdrPDjhiEzsFfJx70dzmRXvgSn Zt2pJfahveuKzryDkjcXCNv3ojwOoNUYJETGHHQvwqd+6PNBttaFbK3o3aiyym5ep0Zz kR/k0T2MWs9bcOr3CuXiCkbLz7SqoP3/rrpCno/mpNVH6Tsatyj4VFRFWazB76Zz/j// +B3g== X-Gm-Message-State: AOJu0Yw4vV1TCnbk6sr+S2QR/8D7Uf4E85C5fqN9P+3Ztpo9NaGeJFlj 6GWfwdCd9e94pDaFfCNwuVmLSLvKIHn5 X-Google-Smtp-Source: AGHT+IHEWSzcyOqyrIspXHkEBu35325xNldQAxjtDeMGt1RE1M8lg7uKewT02eUBUCbRpU96Y5aPdw== X-Received: by 2002:a81:9145:0:b0:5f9:f03e:654c with SMTP id i66-20020a819145000000b005f9f03e654cmr203202ywg.102.1704840946308; Tue, 09 Jan 2024 14:55:46 -0800 (PST) Received: from [10.21.17.221] ([139.104.3.93]) by smtp.gmail.com with ESMTPSA id c186-20020a0df3c3000000b005f75cf6281fsm1115673ywf.5.2024.01.09.14.55.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 14:55:45 -0800 (PST) Message-ID: <65e01c2d170a2f80cc8d2bcd144acaf37d31230c.camel@j-davis.com> 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:55:44 -0800 In-Reply-To: <63cd8625-68fa-4760-844a-6b7f643336f2@ardentperf.com> References: <6b1370d5eaba5e8c42f54c05f7bc2b8e27b8db12.camel@j-davis.com> <804eb67b37f41d3afeb2b6469cbe8bfa79c562cc.camel@j-davis.com> <63cd8625-68fa-4760-844a-6b7f643336f2@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 Mon, 2024-01-08 at 17:17 -0800, Jeremy Schneider wrote: > I agree with merging the threads, even though it makes for a larger > patch set. It would be great to get a unified "builtin" provider in > place for the next major. I believe that's possible and that this proposal is quite close (hoping to get something in this 'fest). The tables I'm introducing have exhaustive test coverage, so there's not a lot of risk there. And the builtin provider itself is an optional feature, so it won't be disruptive. >=20 > In the first list it seems that some callers might be influenced by a > COLLATE clause or table definition while others always take the > database > default? It still seems a bit odd to me if different providers can be > used for different parts of a single SQL. Right, that can happen today, and my proposal doesn't change that. Basically those are cases where the caller was never properly onboarded to our collation system, like the ts_locale.c routines. > Is there any reason we couldn't commit the minor cleanup (patch 0001) > now? It's less than 200 lines and pretty straightforward. Sure, I'll commit that fairly soon then. > I wonder if, after a year of running the builtin provider in > production, > whether we might consider adding to the builtin provider a few > locales > with simple but more reasonable ordering for european and asian > languages? I won't rule that out completely, but there's a lot we would need to do to get there. Even assuming we implement that perfectly, we'd need to make sure it's a reasonable scope for Postgres as a project and that we have more than one person willing to maintain it. Similar things have been rejected before for similar reasons. What I'm proposing for v17 is much simpler: basically some lookup tables, which is just an extension of what we're already doing for normalization. > https://jeremyhussell.blogspot.com/2017/11/falsehoods-programmers-believe= -about.html#main >=20 > Make sure to click the link to show the counterexamples and > discussion, > that's the best part. Yes, it can be hard to reason about this stuff but I believe Unicode provides a lot of good data and guidance to work from. If you think my proposal relies on one of those assumptions let me know. To the extent that I do rely on any of those assumptions, it's mostly to match libc's "C.UTF-8" behavior. Regards, Jeff Davis