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 1rS3ns-00B80G-M3 for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2024 23:34:09 +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 1rS3no-007dQm-OG for pgsql-hackers@arkaria.postgresql.org; Mon, 22 Jan 2024 23:34: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 1rS3no-007dQe-8d for pgsql-hackers@lists.postgresql.org; Mon, 22 Jan 2024 23:34:04 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rS3nj-003CRi-75 for pgsql-hackers@postgresql.org; Mon, 22 Jan 2024 23:34:02 +0000 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-5cec32dedf3so1877481a12.0 for ; Mon, 22 Jan 2024 15:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1705966436; x=1706571236; 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=Vxsh8A/SzRJCKqXdBGg0lRtBVW5I3b+g/gw1zr1lgsc=; b=dNHLmOTVqefQSDGZ8skU+BP4kWueuJRZ+YvNxzlPXLuhptSJS0wH/MYxHjgEzi0CJe O5cho6eF7BoaOli2XGrKeXfQd/HQ6cHhc70rcAnjsoCI+ONBUL78ZYHscVCGUfgaOEaY 2V+GkH4kMwr1YVlbOlr67QvIRTxa6HX+2NyfLtPfGD9wztajV/6jdcg1Inf7Xbh855A6 vL9/6nTFJ6rD0likPuNn6xsjv9vcUQuDIWGXg+1USgG0N9as0ps8HVGiHC2wQQbOHC1q cFSJBROnPnfvJ3qi2KileWPX7Z2dPoeDfyQe1J3xbuFMOAvhUUvFvt40qxgphywZg4jI w5hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705966436; x=1706571236; 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=Vxsh8A/SzRJCKqXdBGg0lRtBVW5I3b+g/gw1zr1lgsc=; b=mXQJbbsLIoqq2bGispr6RedH3EhoboV4917ATEtjjtwJFJCSc415/hA2bVGimBAipH mJqIg00xKUhGkk0uqkHAamOiY+8w0dlJiGwkqoWg3Egya31nqJelv5gzv6MPBdBqvlPK Q5LIAtA5wPOKXFP7Zzibwd9qBTIbKsDUGfkzC7zLdXAiHN4/dA8klyR4XKQKyq0dUbeN 0hNZHlfQeF7bKGAkp/I/XtUXQGPjAKYjXqj2eYI3FgupZ6uviaO1upSDqYM4+6ocZDdc Oju6h+WnlVbwizkUCsoEXp2T7I/KO4Up85zQ+BiZPQQzt+9bOao34eecFj06y6Sp3Qyx LKoQ== X-Gm-Message-State: AOJu0YxoOMPDvRJyYuhco64+NNJ2tSzxzUg/RW0YNCQ5p3RpV+NYhVeV LUvholY8B8z8FFRaTw7+2Qj51SHO4BvDaoiL3YOMKR93DAhMEEiC5sJ2uxHbiA== X-Google-Smtp-Source: AGHT+IHyEpHSJMTpXFw1JofWNQfdoQAIjrFlH1/at1DHE7bzu+LzX6SjPxVmf84mtCBere5PHqQqvw== X-Received: by 2002:a17:90b:1903:b0:290:8808:235b with SMTP id mp3-20020a17090b190300b002908808235bmr1268625pjb.96.1705966436451; Mon, 22 Jan 2024 15:33:56 -0800 (PST) Received: from [172.18.10.37] ([12.126.244.130]) by smtp.gmail.com with ESMTPSA id so18-20020a17090b1f9200b002909c6bf228sm3178347pjb.51.2024.01.22.15.33.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jan 2024 15:33:56 -0800 (PST) Message-ID: <8f105bd641a2fcbddc7c5f0c2ce60731a70da0de.camel@j-davis.com> Subject: Re: Built-in CTYPE provider From: Jeff Davis To: Peter Eisentraut , Daniel Verite Cc: Robert Haas , Jeremy Schneider , pgsql-hackers@postgresql.org Date: Mon, 22 Jan 2024 15:33:54 -0800 In-Reply-To: <2bcd882a-cf20-40fc-84eb-5c5c6365ff56@eisentraut.org> References: <6f3e94c0-f174-4380-9b69-072f8a838881@manitou-mail.org> <12e4f6a78403b33c303c20e44976f891d879be09.camel@j-davis.com> <67df0672-5bc0-4b2b-b9e0-00e12bdca601@eisentraut.org> <3c1f4043bb4f76de78160f8afc8678eaa10b0e46.camel@j-davis.com> <2bcd882a-cf20-40fc-84eb-5c5c6365ff56@eisentraut.org> 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-22 at 19:49 +0100, Peter Eisentraut wrote: > >=20 > I don't get this argument.=C2=A0 Of course, people care about sorting and= =20 > sort order.=C2=A0 Whether you consider this part of Unicode or adjacent t= o > it, people still want it. You said that my proposal sends a message that we somehow don't care about Unicode, and I strongly disagree. The built-in provider I'm proposing does implement Unicode semantics. Surely a database that offers UCS_BASIC (a SQL spec feature) isn't sending a message that it doesn't care about Unicode, and neither is my proposal. > >=20 > > * ICU offers COLLATE UNICODE, locale tailoring, case-insensitive > > matching, and customization with rules. It's the solution for > > everything from "slightly more advanced" to "very advanced". >=20 > I am astonished by this.=C2=A0 In your world, do users not want their tex= t > data sorted?=C2=A0 Do they not care what the sort order is?=C2=A0 I obviously care about Unicode and collation. I've put a lot of effort recently into contributions in this area, and I wouldn't have done that if I thought users didn't care. You've made much greater contributions and I thank you for that. The logical conclusion of your line of argument would be that libc's "C.UTF-8" locale and UCS_BASIC simply should not exist. But they do exist, and for good reason. One of those good reasons is that only *human* users care about the human-friendliness of sort order. If Postgres is just feeding the results to another system -- or an application layer that re-sorts the data anyway -- then stability, performance, and interoperability matter more than human-friendliness. (Though Unicode character semantics are still useful even when the data is not going directly to a human.) > You consider UCA=20 > sort order an "advanced" feature? I said "slightly more advanced" compared with "basic". "Advanced" can be taken in either a positive way ("more useful") or a negative way ("complex"). I'm sorry for the misunderstanding, but my point was this: * The builtin provider is for people who are fine with code point order and no tailoring, but want Unicode character semantics, collation stability, and performance. * ICU is the right solution for anyone who wants human-friendly collation or tailoring, and is willing to put up with some collation stability risk and lower collation performance. Both have their place and the user is free to mix and match as needed, thanks to the COLLATE clause for columns and queries. Regards, Jeff Davis