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 1wJej9-0006af-2b for pgsql-general@arkaria.postgresql.org; Sun, 03 May 2026 21:51:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wJej8-004oil-1D for pgsql-general@arkaria.postgresql.org; Sun, 03 May 2026 21:51:50 +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.96) (envelope-from ) id 1wJej7-004oid-37 for pgsql-general@lists.postgresql.org; Sun, 03 May 2026 21:51:50 +0000 Received: from mail-yx1-xb12c.google.com ([2607:f8b0:4864:20::b12c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wJej4-00000000L7q-4BZN for pgsql-general@lists.postgresql.org; Sun, 03 May 2026 21:51:49 +0000 Received: by mail-yx1-xb12c.google.com with SMTP id 956f58d0204a3-651c5d525f6so3059990d50.3 for ; Sun, 03 May 2026 14:51:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1777845105; cv=none; d=google.com; s=arc-20240605; b=ER+zOYNz5iOsUbU8j+qf/ActMY/MmZvW8c/WZ32prYEOIYgqtGwNG49iw2BGxKUcbJ u1HFkKvefgAP+n2yrw2MV08G7l0I77bxzAlwLj/gYkGE8zZ7ulRFMkTJHSEYHXsWoU2G G/oJL6nJuZ+wDCufzPxix9aXbVMFrruarqscc+Ocy5Pz3MnkXHR66bpvNhFchm1+TY7B TzuFzE8EV2fr092g4gdN8RYKk20s9a5UK6bM+BEdlv+CF3WinC1NqU8/pVflPOPlojlw N7/k523DQG+BfM8xnLPvZXlPBKpGjjKAtAuFXqIQ8loP3TW0u9FhnCjQw8Wp1tSq8prU x4mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=PeFIZm2xCqLskvpwf+5Jf1vMRfkFsVHiI1YNjYe8L9k=; fh=62t45thEESFHW26s/3eSIW7ZBLrm/6+FSGDBE0p5NEQ=; b=SsL0Xcqsof0U3aiuGrFYxZ8tNv30h7H6nidcBIDaw7QocxTp1bwRz2Yk2c3baYdFlf YSvWBf+jw+OJMJesdqDk1tcNxjiy70q+kEotBQ4iVsKTdCKkgZgYyIzht2WQejJ3Szy5 0i3IXx1RD6Nt8/uvw20DKkyLttdaDYnHV7rnnpBgKJgqXDNiiyjiRbkl9+iJBqe7LPhx vXXB/XAyX2+/5Xtf4G4FHAmL8NbpT9yV+f4KrUw+zNAtqwCDPijtejy55EcHXsrbTqUr MnwdeNEnKNhFkwP7SxXm8amhlwKcNwXdVhHtdjKQffZcPVia1rWi5S75wGZPn7g4r7WE SJqQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777845105; x=1778449905; darn=lists.postgresql.org; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=PeFIZm2xCqLskvpwf+5Jf1vMRfkFsVHiI1YNjYe8L9k=; b=iTBePMx65cuSvj+mXkLRcir9oTthrjmFG3o4Ejn+ElLc/AKxed3FUtYX/sbqmDgTLj nviqK9aZGwUOWH+IYXFaV9XqkUttUfkLP9JCcVQQa69uP0MWJkwP7CGj94AKaibwZeCI TTcKQNSS2WnmlbOZGfRry7T7GiNfe1uIlsgxRr5av0etfnIQJMG0JQTXC+JKcZLMRWVS BxMbdWUKB5q66C7Mpco5O7KpLSyxzf/Fhu+MqVJsjAhgkKljZkQQfgbFTgSyfAlazk/H uBnA/ez/1680uucjVB3xOc1junHKz7hdavqh2+hVV/FTbsFlioTBKYL9m5H0VTQQU/1a HnbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777845105; x=1778449905; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=PeFIZm2xCqLskvpwf+5Jf1vMRfkFsVHiI1YNjYe8L9k=; b=WkNkpXSSrvluCSySNLxSe/xfwqoJywQ6yACm5uKlDvzJuQptqquQkyBS9Chk3pGZTW fWePrK5r3A4Tz2BAckdPLrpYmXDkZKhapWEhZT3fE33akGIhSZXjoGGSE7P+/SHOhawO b+6dFEjGAz1trXi7RPAfLkBJSWBwdDgmYxF9bQxnwl8LEEnxSaGHJ7SBX97BHQ6E78C8 asMBFl1zE05l+N2HjsVzS5hHGOs+4zw0XKDU3dmLH5J/9p1VdTeX9QUGfzJmc9mPm91z Kqm4SCZoFYCvXGVUIdWYiGDOTRmd32liLcnvy33/16UY1L/lqnNOKj5QioEzyg0IguBc EwPA== X-Forwarded-Encrypted: i=1; AFNElJ+pDpxlkIXX67Pd81eNJXgyN2z+raLHnCGwT+Yg9qpxzfm5ZgZL6sQdMAmLu4Qst5p73HlpTwEzUzpaMHwT@lists.postgresql.org X-Gm-Message-State: AOJu0Yzyob0PEs47RBv0rJQl9vSoQzJE1MHELMF4Iss/l3ouV8xHgLqU 99VoDrHba1vds03hUH8VbQh9C8LwnW2cou6luv4Y1tbplhwio3WlIZugMaclSzCzUBoxnsI87ab MpuL3mSy47usV43XrOSmQYoOJMIH+Vrk= X-Gm-Gg: AeBDievucwj1fHfGHBdNu5FznWGnyg9fz0/6ohKhbBJdEtIgZgZx6+HcOVbJKbNHXWO iOeOkJWgKUtbQQC09q6OP1Rz8J8DX1bWwIYegnJ56mWBNYXn61BaBwMootYvlA0KR4ZNXaZwGbB DEDsuC4etKW++EiG+ztweBeGtyRTAbSFJoxuYl3sXTaGitsZ0WWkacij1RNB9IX4evwP65ADCpH n5EJMmtbjAQlq44cFZB0/Zxx22MxGhqSIkYsGqDZSEQq4ohEhnkUei2zvZVob3udABKyJwWsQKg m9FXhlLVgpJSCillJdVDQ/ts6Kps5nHorMZ6MYLSZAFlBc6L1a72fX3E3v2xvrSV X-Received: by 2002:a05:690c:1c:b0:7b9:39f:62c8 with SMTP id 00721157ae682-7bd770da740mr78087027b3.27.1777845104728; Sun, 03 May 2026 14:51:44 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Igor Korot Date: Sun, 3 May 2026 16:51:32 -0500 X-Gm-Features: AVHnY4KsV5N4JflKmMIw2SwysEPkanHwgof5DIYzgamHnPrHgV37gs1SkGn-T2U Message-ID: Subject: Re: Choosing default collation/ctype To: Ron Johnson , "pgsql-generallists.postgresql.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Ron. On Sun, May 3, 2026 at 4:05=E2=80=AFPM Ron Johnson wrote: > > On Sun, May 3, 2026 at 4:52=E2=80=AFPM Igor Korot wr= ote: >> >> Hi, >> >> On Sun, May 3, 2026 at 3:09=E2=80=AFPM Ron Johnson wrote: >> > >> > On Sun, May 3, 2026 at 3:52=E2=80=AFPM Igor Korot = wrote: >> >> >> >> Hi, ALL, >> >> In the CREATE DATABASE statement I can use encoding/collation/ctype. >> >> >> >> I can retrieve the encoding list with: >> >> >> >> [code] >> >> SELECT pg_encoding_to_char( conforencoding ) AS name FROM pg_conversi= on >> >> [/code] >> >> >> >> And then I can get a list of collations/ctypes with: >> >> >> >> [code] >> >> SELECT collname, collencoding, collprovider collctype FROM pg_collati= on >> >> [/code] >> >> >> >> And then add a logic in my UI to switch collations/ctypes based on en= coding. >> >> >> >> However, what I wonder is: >> >> >> >> Is there a way to select a default collation/ctype for a specific enc= oding? >> >> >> >> Or maybe I'm overthinking it and I should let the user choose and if >> >> nothing - just keep those 2 as "Default" and let the server pick it >> >> up. However it will be weird, especially from me as a user POV. >> > >> > >> > You know your data, not us. The first question I'd try to is "how muc= h client text data is not compatible with bog-standard UTF8?" >> >> I don't. >> Just trying to create a generic tool to use for people everywhere... > > > Then choose UTF8. Let me give you a quick run of what I'm trying to do: In my code I have 3 combo boxes: encoding, collation and ctype. Initially they all have a value of "Default". Lets say a user selected "KOI8-R" as an emcoding. What I will do is populate collation and ctype combo boxes with values available for such encodings. But I want to go a little further and change the values in those to be the default collation/ctype for the "KOI8-R" encoding. Now are you saying I should choose the one that have "UTF8" in it? Thank you. > > -- > Death to , and butter sauce. > Don't boil me, I'm still alive. > lobster!