Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHPV5-0004g2-SO for pgsql-general@arkaria.postgresql.org; Mon, 16 Jan 2023 13:26:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pHPV4-0006qc-Ko for pgsql-general@arkaria.postgresql.org; Mon, 16 Jan 2023 13:26:10 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHPV4-0006qN-AJ for pgsql-general@lists.postgresql.org; Mon, 16 Jan 2023 13:26:10 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pHPUz-00081N-Pl for pgsql-general@lists.postgresql.org; Mon, 16 Jan 2023 13:26:09 +0000 Received: by mail-ej1-x635.google.com with SMTP id v6so25069973ejg.6 for ; Mon, 16 Jan 2023 05:26:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; 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=OhI6a7yI1Rt/dM8MbZlgaAIjRVi+g7cmqaUANRSiLzk=; b=xobTLK909JGJjv8k1XcRJ/Q5VQ91voVZ2msqtYgVBxxvHHlucOMbMVy3HT/ViwnWaF HR/M0xhGkJuwb6yolAJ7KA+FHXItb5uRmTzWFE2AvOKZV5WS/a8N50nThx052rTDVZcT rwANtU+5PTBpWuHrjRGZ7v9l6n/ycUBPStnElVOZTcSdMQzl+VmbQzaCX8c0UM3+iW91 6i7U+0R6UgIxcwcKRgk4pw6RVJeHLu5zaywKk3zF0aYGAXhz6R9hz1gTTZksPi++brC5 TCD7pZcA3TXVTOrYRc1GVkdAciJngqvR8N6H9X1I5yb5EjCHpIYFuwwGIhgQNRPlGHhf N5gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=OhI6a7yI1Rt/dM8MbZlgaAIjRVi+g7cmqaUANRSiLzk=; b=otd+auxuKx1dyyeOJpGbmgfgj5KV4QgGm2BDUJYZXcUbPvZD/l+KRUfkOlyZa7GAvg qwWUc/aQap745nVEaavJ0cXiFMdPc308zzS9VhKoao3zK/qwqxBLxDEwdBiHu01H639m c2RuCwaGkt8l/a/qgJkRNQTeeiJKKcvCYaJBSbjh24SSs0b2UxH4KzxpuVbA9rKEI4wT fLv2CoRW1pGI3OSHqogXcx9ikqSfFpIIdPbQ265hvVVK7RKsagBNLLuJHvhz5wajm9Tc JYv1JzsMTz540sKvDu18F6Izwk9uEt0gLfdC6miUeUa9ABEmKJmJLCfD0dQW3b5rceAO vK4g== X-Gm-Message-State: AFqh2krFN6VK/b7bKxYQNgL0/km/6qTSkY5CqIAc+92c842TKFQj9u3Z Qi/Mw8kUmJ+SZPL70Oyf1kwumw== X-Google-Smtp-Source: AMrXdXt9TDoxUr8v5vV53UMYIvurqFLA4pSzAGPG/LH988ClgUvqvkcJDg4Bo+sqLaJMckN2jZzTGA== X-Received: by 2002:a17:906:838b:b0:851:97ca:7fc9 with SMTP id p11-20020a170906838b00b0085197ca7fc9mr24647842ejx.40.1673875564166; Mon, 16 Jan 2023 05:26:04 -0800 (PST) Received: from localhost.localdomain (62-47-151-167.adsl.highway.telekom.at. [62.47.151.167]) by smtp.gmail.com with ESMTPSA id b17-20020a1709063cb100b0079e11b8e891sm11725711ejh.125.2023.01.16.05.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Jan 2023 05:26:03 -0800 (PST) Message-ID: Subject: Re: glibc initdb options vs icu compatibility questions (PG15) From: Laurenz Albe To: Robert =?ISO-8859-1?Q?Sj=F6blom?= , pgsql-general@lists.postgresql.org Date: Mon, 16 Jan 2023 14:26:02 +0100 In-Reply-To: <1e8c876d-a719-c7c3-c71f-c6d527239fe8@fortnox.se> References: <1e8c876d-a719-c7c3-c71f-c6d527239fe8@fortnox.se> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.3 (3.46.3-1.fc37) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, 2023-01-16 at 09:30 +0100, Robert Sj=C3=B6blom wrote: > We have a fleet of postgres 10 servers (1 primary, 2 replicas) that=20 > we're now planning to upgrade. We've historically been forced to use the= =20 > same distro (centos7) and libc version, or rely on pg_dump/restore,=20 > across pg versions due to the fact that the servers/databases were=20 > initialized with the following options: > --lc-collate=3Dsv_SE.UTF-8 >=20 > We're upgrading all servers to pg15 through logical replication, and=20 > with that we'd like to remove our dependency on any specific libc=20 > version (to avoid corruption issues etc). We hope to do this by=20 > initializing our pg15 clusters with swedish icu locale=20 > (--icu-locale=3Dsv-SE-x-icu). By using icu like this, we should have the= =20 > same sorting behavior as the pg10 servers have today? By our=20 > understanding, we then should be able to use physical replication across= =20 > different OS versions, without worrying about index corruption etc? >=20 > According to=20 > http://peter.eisentraut.org/blog/2022/09/26/icu-features-in-postgresql-15= ,=20 > we still need to set a regular libc locale/option; does this mean that= =20 > the dependency on libc is still present as it pertains to corruption=20 > issues and being forced to use the same libc version across all replicas? I'd say no. The problem is the collation, and for that, the ICU collation will be used. The libc locale is for other aspects of locale. > Our current initdb arguments for the pg15 version looks like this: > --lc-collate=3DC > --lc-ctype=3DC > --lc_monetary=3DC > --lc-numeric=3DC > --lc-time=3DC > --encoding=3DUTF-8 > --locale-provider=3Dicu > --icu-locale=3Dsv-SE-x-icu > --lc-messages=3Den_US.UTF-8 >=20 > Does this correspond to the same behavior as our previous (pg10)=20 > servers, but using icu instead of glibc? Not the exact same, since the libc collation and the ICU collation will not be exactly identical. But you should not get any complaints from your user= s, since the collations are presumably very similar. Yours, Laurenz Albe