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 1uRZFB-00DUcj-Ms for pgsql-general@arkaria.postgresql.org; Tue, 17 Jun 2025 16:33:05 +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 1uRZF9-00BHse-Sk for pgsql-general@arkaria.postgresql.org; Tue, 17 Jun 2025 16:33: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 1uRZ2p-00B87C-Vn for pgsql-general@lists.postgresql.org; Tue, 17 Jun 2025 16:20:20 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uRZ2o-002Zcp-0a for pgsql-general@postgresql.org; Tue, 17 Jun 2025 16:20:20 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-310447fe59aso61695791fa.0 for ; Tue, 17 Jun 2025 09:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750177216; x=1750782016; darn=postgresql.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=ypWtxwjexlgYNMwTLkuv2eUC3tW/lJBLzjHY4ULRAN8=; b=gJXSDcOOlbTwu2OJM6e6QvPuLlI7pPdcsCoXOCNX2RGxzlO8qZtM2n4wlEUUNMkPAH TUW6bORmi9v77e9OqXC52muMpx7V1kMNBYH8vlU++0I0KRw5FtlnQj/6m+f8cFcB4Y67 uEkvbei2lU9g8q9tiGQTYgxrrWxFcb26rilngaUsIlVdPYiRM4/htp7cZUAMdkR+rB3M N0PsYeUAyIi+/7BKrNeov8LBW0ChTAr2PxHOuB6+7urCcgVCJYUOfX+HZeJ9MNS8QsW9 HLt+rsj6MFsPZDosa8iCbdw+L7HWnMtnFDUGDg0q9Km5WMCfk5bwNprbf2BbKzs8G18X LmaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750177216; x=1750782016; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=ypWtxwjexlgYNMwTLkuv2eUC3tW/lJBLzjHY4ULRAN8=; b=ZoZCKnjQuCwBuBGBHFv/4CSt1pkdhOeT/amI155bNDBQyBRJCtXtu88rngWgHZ4d0U idplcBn2ORduEVHo7ABhGFvSjAu07UG9DfdbdwmiFOu3Ha0e9TYEXiI6bX6E8nSJTrp1 8JSH2bF6R65Gs/zIDj7C1w6PGaQsolRf+0Nm3+tIFkR/HHQ54bAT6qLLfgicBCleZfZS JZBJJR3+ZNGTLsRmqjjbGs3T6VuDk2qY3xdy+/qOxtnV8Z2XxwaE70K/6nTGeypLCkiA xx7Ng1+zr2CHkU2c2IoiAr02MS6FvIdzgXsUQYMitgB9AihrjrIhWxT47vskcCrN2k5p FErQ== X-Gm-Message-State: AOJu0Yz+D4+BVKu7ramexc3Oghv8rE/Fjl3VdAeNXn1z72d067MfEdzS kkNOWiIzBZprzgVIoJERxTZZaIsWpWhOzUaxUkTLjMzWYiwIPw8ae1BfK2J9WwCGPRkQxvtg61g 95O8uIevVs6BR1jCJH+PFMeZRl7TlgaOW8duQ X-Gm-Gg: ASbGnctpTxOXgteQm+xbpqCAhclO2Wj1yhgRATmxS/0K+GRYjYGwMgpi+/MF8zA9NGs l+6gv7c5jbPWCuhK4GH5Eni8wGtTZydNi+5ylXHSBaOqKzDPVLvOYPXyP3rpA8LUeSnc8OZsURY HZvPMqvjVL5yyUhCzEni70zWgpkJUTVlVKtvN8GdN7Caif X-Google-Smtp-Source: AGHT+IFaHj137NaAMD+UyeTquhRjLOUjYQ1u+74apegU1/pGhu5LhIifEFTIYdaB8lTTIbtkYUKoBv3QJ0kCGtzbg6M= X-Received: by 2002:a05:651c:4ca:b0:32b:50d8:f122 with SMTP id 38308e7fff4ca-32b50d8f261mr36177901fa.40.1750177216184; Tue, 17 Jun 2025 09:20:16 -0700 (PDT) MIME-Version: 1.0 From: Marcin Gozdalik Date: Tue, 17 Jun 2025 16:20:04 +0000 X-Gm-Features: AX0GCFvLUFnKORgDvtT6r_mPkuqEzHHr93rwyo1BRU3RtPSPyF9Dqu83_AHlJoE Message-ID: Subject: Changing locale of an existing database To: pgsql-general@postgresql.org Content-Type: multipart/alternative; boundary="00000000000043c4050637c6e3e7" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000043c4050637c6e3e7 Content-Type: text/plain; charset="UTF-8" Hi I am using PostgreSQL 17 and would like to take advantage of performance and stability across OS updates of builtin C.UTF-8 locale. I have a cluster with a DB created with en_US.UTF-8 libc locale. I would like to migrate the DB to C.UTF-8. Ideally there'd be an "ALTER DATABASE ... SET LOCALE ..." command that would take care of it but it seems it doesn't exist. I was thinking that I could change the collation of all TEXT/CHAR/VARCHAR columns in all the tables to pg_c_utf8, REINDEX all those columns and change the default locale in the pg_database table. Is it a sensible plan? Am I missing some steps? I can't find any reference to anybody doing that before or discouraging it. Thanks, Marcin -- Marcin Gozdalik --00000000000043c4050637c6e3e7 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

I am using PostgreSQL 17 = and would like to take advantage of performance and stability across OS upd= ates of builtin C.UTF-8 locale.
I have a cluster with a DB create= d with en_US.UTF-8 libc locale. I would like to migrate the DB to C.UTF-8. = Ideally there'd be an "ALTER DATABASE ... SET LOCALE ..." com= mand that would take care of it but it seems it doesn't exist. I was th= inking that I could change the collation of all TEXT/CHAR/VARCHAR columns i= n all the tables to=C2=A0pg_c_utf8, REINDEX all those columns and change th= e default locale in the pg_database table.

Is it a= sensible plan? Am I missing some steps? I can't find any reference to = anybody=C2=A0doing that before or discouraging=C2=A0it.

Thanks,
Marcin

--
Marcin Gozdalik
--00000000000043c4050637c6e3e7--