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 1sdvkn-002KoK-9z for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Aug 2024 17:56:17 +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 1sdvkl-005Osa-1S for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Aug 2024 17:56:15 +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 1sdvkk-005OsS-JC for pgsql-hackers@lists.postgresql.org; Tue, 13 Aug 2024 17:56:14 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sdvki-004gp0-8p for pgsql-hackers@postgresql.org; Tue, 13 Aug 2024 17:56:13 +0000 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-70d2ae44790so4146307b3a.2 for ; Tue, 13 Aug 2024 10:56:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1723571770; x=1724176570; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=KPRFxbfIgvY5Kx6oSi8itNE1BT00cjdpUXI2vrnHWSU=; b=eUitRodsZtGVOgNjQV4U/92f9lPeU2fn+mzMueHtLGjLlyo9+fjUWt5lK/GT5ERrhE ERsDWTkA/Lu1QTY99jKryFm6jVddOl0e0Eabrhhrti6Z3RssJeKprVSAj3cLG+sSvIMe dwksMKmVRl0JFBWvMDNyAr0WIYND918F6aQ/Nz5gXha/wdQf/L6aTkwtMUkRJQAnLweQ 3tcyjnliBan/czKmo9aVQ+tdEGFEhKruHAh1sdg8RtAwVb0oJ9rP2MLqq6+XCyfOt7XP wl1jtrt6imaynZAemekbSJW0y4gxxkb5RVgcZXDhjrNtXpN94mxjaYanHfZ5Pue5kLMv pf9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723571770; x=1724176570; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KPRFxbfIgvY5Kx6oSi8itNE1BT00cjdpUXI2vrnHWSU=; b=v9DzJkEZ/mevksERIDY4KLIwn6rw2eOYMmPxH9UzwVhUsxpW/x7S8ngAqcn3sZhSBj FGqV0w7HY15G8303sWQhI7hGoD3NcChpj0eM8u/0DLG4g/YgEYuUgqz3PEKjIvje0AtU uCRETHzbhPJEksgMYMccYIMUt+uw65ZVQ7EveirDFK7nTxtnFiqwl0UslBrtBuApHOoI nLAe94FBpusseDYdv33O9+PEhNSBK4LAMVIiTF9QhDYrIwhCtBC5v3VCdusJAG9U6NUb 2MRwzchfbn7EjeqTYfpvQSe0xYInO97q7S3d9ZELUm1ajs8EOIVQHxv4yI4YnOzP5r0j Usbg== X-Forwarded-Encrypted: i=1; AJvYcCWLhB/wPufNgbJD57grbDiDNezEaPMGblw+vhgtF80p1Yq6M//YuVxiOL5e12RmX07EZ+k2glsv1SFUhgky45yb9QdTkClIPc+4BGov X-Gm-Message-State: AOJu0YxS99Sk2OYTEcBkYkVRkEXMp95xufub90MKRFgxtclVlG1nOgqT Ilf0a5XnaKKv1qHQIAMowmdT9Mjs8dpc8YNbDS2Anm8f6EyELKdn5+3wbfa1qA== X-Google-Smtp-Source: AGHT+IEhk4xhCymB6GGRLRsNOnQwoC0k1mssS9KReyV8lI8k26IUmbMhMKHPT84/6jdx0SH4Eg/QkQ== X-Received: by 2002:a05:6a21:9d91:b0:1c2:9095:7382 with SMTP id adf61e73a8af0-1c8eafd7152mr395210637.52.1723571769503; Tue, 13 Aug 2024 10:56:09 -0700 (PDT) Received: from jeff-laptop.lan (c-76-102-242-158.hsd1.ca.comcast.net. [76.102.242.158]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-7c6979ecd7csm1777335a12.28.2024.08.13.10.56.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 10:56:09 -0700 (PDT) Message-ID: <96d51fbb8b6f338a210cee97abb63c0162bcb781.camel@j-davis.com> Subject: Re: tiny step toward threading: reduce dependence on setlocale() From: Jeff Davis To: Peter Eisentraut , Andreas Karlsson , pgsql-hackers@postgresql.org Date: Tue, 13 Aug 2024 10:56:07 -0700 In-Reply-To: References: <2228884bb1f1a02614b39f71a90c94d2cc8a3a2f.camel@j-davis.com> <239b7ef6ce058c6b1c77b3a0cfcc70c1cd8968b1.camel@j-davis.com> <56af65bde2190cc5ee20c807be7b7bdcda54f40c.camel@j-davis.com> <468dd1fb-20f5-4213-bc70-d1388ccf28fa@proxel.se> <59ea4275d75829a055fc55d8fe139eb85764cf2b.camel@j-davis.com> <89475ee5487d795124f4e25118ea8f1853edb8cb.camel@j-davis.com> <23cc1f3cfcdbdd3b2d3bb956d57ae422aa9d0b9e.camel@j-davis.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-08-13 at 17:11 +0200, Peter Eisentraut wrote: > They used to be completely separate from > pg_newlocale_from_collation(),=20 > but now they are just mostly a thin wrapper around it.=C2=A0 Except there > is=20 > some hardcoded handling of C_COLLATION_OID and POSIX_COLLATION_OID.=C2=A0 > Do=20 > we care about that? ... > However, it's not clear whether the hardcoded handling of some=20 > collations is needed for performance parity or perhaps some=20 > bootstrapping reasons.=C2=A0 It would be useful to get that cleared up.= =20 > Thoughts? There's at least one place where we expect lc_collate_is_c() to work without catalog access at all: libpq/hba.c uses regexes with C_COLLATION_OID. But I don't think that's a major problem -- we can just move the hardcoded test into pg_newlocale_from_collation() and return a predefined struct with collate_is_c/ctype_is_c already set. +1. Regards, Jeff Davis