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.96) (envelope-from ) id 1vybN1-000FWK-0F for pgsql-committers@arkaria.postgresql.org; Fri, 06 Mar 2026 20:01:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vybMz-006tCL-12 for pgsql-committers@arkaria.postgresql.org; Fri, 06 Mar 2026 20:01:57 +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.96) (envelope-from ) id 1vybMz-006tCD-03 for pgsql-committers@lists.postgresql.org; Fri, 06 Mar 2026 20:01:57 +0000 Received: from mail-dy1-x1335.google.com ([2607:f8b0:4864:20::1335]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vybMw-00000000ouM-2n7m for pgsql-committers@lists.postgresql.org; Fri, 06 Mar 2026 20:01:56 +0000 Received: by mail-dy1-x1335.google.com with SMTP id 5a478bee46e88-2bd9a485bd6so3117211eec.1 for ; Fri, 06 Mar 2026 12:01:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1772827314; x=1773432114; darn=lists.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=X4LMmXdCXR/8dIV/xS+orkXdJdjiHaLY5xj7a+qjgTk=; b=DqzH0EHQWJJXaTo+53ZLix6hHLR8DE+T6tYDdvPKmTA+rmRRDF6q8UyEI4vEQ+L8GY kU6rtadV/+/ndje5Q2ch59/5j48A2L42Ufl+YAuHUZiAnSPbIu3t4b8jV8q+kHj7F92b ClQGgPnMQUl7BeddAXhs2ydn3Vw0CgOvyp25ToRt3EBWmR8rAYqE8/YMgNxvDhV66Cc6 ynQjdU8/UYG8lSduC0ATEr3pHBGDdH3CYCX6d6Fc8X52gcWsQIKs0kwsb+9C8ZXvrKhp CeDSRI8zxx+2EPsknMjBgzYhg41J3L1GndtZMgpPPykRecfTxEsveo4yySF/KMG/sXHs MouA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772827314; x=1773432114; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X4LMmXdCXR/8dIV/xS+orkXdJdjiHaLY5xj7a+qjgTk=; b=NosEoFwJgWIwX7zcBoXVFktvJ7EepXGbdKGAIuTv3JNO74QProWemapBg+3HoJp/W3 WKlD31jmDFhPspFikfD8sOTeIlbEp0za6d3deEeZJsJNab/446n3xKmEzej5Mmr1pUkD TN69nT33b35lq+KPlTKM7wOoHB6VM+4K+YUilpg5qQnCXa87nNpB6x4rNtQroVmEGh6o a4N6HsUp5QvpISv7fhR0uEY2hrA8V5Yz/NOd22D9KPkwlBkqd6TdPzZ6nD9op1ntAQ52 o8ri7JCu0fmFRdh2KA49Nx/pp4sTzb/OYjkgng97yTZp6TUfrOtLEg7kcA6o8tXw1hl1 sZhg== X-Gm-Message-State: AOJu0Yw2GS6NeycatfzOFSY/u59z4OcTUMzY3f9YE00EiWrX6BGemCOk XYDgf7ekxjKa5pT4zaTgq0eUL03aqmFxAspvR4n/QtEuRbOr0wgEaTbjSk9L0+manA== X-Gm-Gg: ATEYQzwrM8Y2tymJOUSPuJ+qbyN/m65FO8ikVBk+ta2DqQ/Kyj0nVnjaHqBYb9XM9VM /Wc5seR1B39CgY82rhMDFFul4ktSC6RITiMkzltCKU5tICtZgPz2eGl0o89vdZeRq4DITAnIQCt wubFItTTuNv0MdKLs44bmHlSlB/WZcNqnjzGoTID40wyt1kXjIcHeUIIXEdWpzgNoY8qiWHqS93 Uy0aBcvx+aNhNaB7SkVu3J2yXDHl11Y861u8cP9hgpJcMQ/B3RHHtcll5Phf8bHIkQ2IwBXf7jV /ONRIdf19HpV47yb10HrodIiNzBJGdxGPA4GN7APjnw092rHIrmZ5VGyN7Zq4EZTWBI5UWYfbjR lJ/OUhsNSQ/X7jZjQRso1FI7sf2hb07z2d6WBkVK27j372Xvejhl8lkVL9O6nfHqhhYIN/zx3Hb YwV90FvKpDP6oz1bxRMnc/1ff7FyzivXKRoPhRiUjjKK59Lb/gsIVbu3j6fgvJLw== X-Received: by 2002:a05:7300:bc0c:b0:2be:6f6:a39f with SMTP id 5a478bee46e88-2be4e05be8bmr1558233eec.26.1772827313408; Fri, 06 Mar 2026 12:01:53 -0800 (PST) Received: from jeff-laptop.lan (c-24-7-19-3.hsd1.ca.comcast.net. [24.7.19.3]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2be4f807714sm2323860eec.1.2026.03.06.12.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2026 12:01:52 -0800 (PST) Message-ID: Subject: Re: pgsql: Perform provider-specific initialization in new functions. From: Jeff Davis To: Andrey Borodin , Jeff Davis Cc: pgsql-committers@lists.postgresql.org Date: Fri, 06 Mar 2026 12:01:51 -0800 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.3-0ubuntu1.1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 2026-03-06 at 20:24 +0500, Andrey Borodin wrote: > I'm toying with my WAL compression patch. This test is segfaulting > for me Thank you for the report! > wal_compression is PGC_SUSET, so when a non-superuser sets it via the > startup > packet (PGC_BACKEND context), set_config_with_handle must call > pg_parameter_aclcheck -> SearchSysCache1(PARAMETERACLNAME, ...) -> > hashtext -> > pg_newlocale_from_collation(DEFAULT_COLLATION_OID). It seems like the real problem here is in catcache.c:texthashfast(), which unconditionally passes DEFAULT_COLLATION_OID, despite the fact that pg_parameter_acl.parname has collation "C".=20 namehashfast() uses C-like semantics, which is OK because all name columns in the catalog have collation "C". But TEXT columns in the catalog are about a mix of DEFAULT_COLLATION_OID and C_COLLATION_OID. There are a few possible fixes: 1. Your fix addresses it, and would also add some safety against other edge cases we haven't caught yet. The only time it would take effect is for very early initialization, but there is nonzero risk of inconsistency because the same value would get a different hash before and after CheckMyDatabase(). 2. We could hardcode texthashfunc() to use C_COLLATION_OID. That wouldn't match the column collation, but it would avoid the crash, and might technically still be fine: the default collation is always deterministic, and all deterministic collations have the same equality semantics as "C". Even if the proper hashtext() is used somewhere else, then it uses "C" hashing semantics for all deterministic collations. The problem here is that we'd like to allow the default collation to be nondeterministic in the future (Peter has mentioned this a few times), so relying on this assumption is fragile.=20 3. We could try to include collation information in the cachinfo or somewhere and pass it down to find the right hash function. This feels like a better fix, but there could be other areas we miss that are using a catalog TEXT field with the default collation. Also it's more invasive. We could decide to do your approach for now (in master and REL_18_STABLE), and then leave #3 for the future (master only). Thoughts? Regards, Jeff Davis