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 1n85dR-0002p6-KO for pgsql-admin@arkaria.postgresql.org; Thu, 13 Jan 2022 19:19:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n85dP-0004eM-PT for pgsql-admin@arkaria.postgresql.org; Thu, 13 Jan 2022 19:19:43 +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 1n85dP-0004eD-AL for pgsql-admin@lists.postgresql.org; Thu, 13 Jan 2022 19:19:43 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n85dL-0006jn-7G for pgsql-admin@lists.postgresql.org; Thu, 13 Jan 2022 19:19:41 +0000 Received: by mail-wr1-x429.google.com with SMTP id h10so11984745wrb.1 for ; Thu, 13 Jan 2022 11:19:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20210112.gappssmtp.com; s=20210112; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=032NzjufIlibyu7ISKz0JWO9ayivvi/Za/+DKIgyuk0=; b=BftoIAZmD/Lxj5L7oaAza3yMkvrST4WGdoZm8UT0U/0oIyap2W8j1/dXsqIDjwh282 S0n7DrhoMpdB0tP+osniJMhdi/1TgCXPQPoOVJf7YuJK7d79Tr2phdN/h2fcXbpEXaKI SXj0CdBiwvrlwEMHHPH1Sv+kaooEfQXHDBBx8xO1SdTViYnkTKNCd/Vt6NWbhogcMhEF siliYsAb2zn8jHy2dxRf3jqTJvmjX1EgnBEPQP+HgG6aRjmhchWgoRdgR6qxGgVEpZdp JdeYvziP5K9aiAFSHK3K+vnGUFvkC7H590RrZ3W57hBPx3p/zhlu7CxZJOiGsvRSRiTF N13w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=032NzjufIlibyu7ISKz0JWO9ayivvi/Za/+DKIgyuk0=; b=GRbTU9xfwzqXjzemSY1WNdpljdKcoOTYxqUHtWDacmwonZ/hm9zzDcMq410yLBPhv/ XbdncGwJfn2wrcNgadaIR+aaHGuOqFMNgXaOTQge/qREL1Unzh+aZreRzEbGGb55vvgA UEet9Js8L9D//vi+UgvTsr8aNQ59n8DvCh7AK/laN29zROtv5zD+NdvJd+RDmXnzO+pr QjqIUWKFVWzalKAaK4REw0Qm/dJb3zzXh1JF9bOoQWlQC4rMRQ0YB19xluCGZXHzJ9FA oOXY8jNZoEPWLPBHe5viWmAr38xkZlvLDF2VMkxAqghAR92pAYFGZarMrdYIqsaI1HPr hgtw== X-Gm-Message-State: AOAM531Js+KinPgkwO3d2NVIS9WN8U2ttHhYXg57lY5QaiN3lPVNTevm +dPqjeiyZdq8+j1ysGCcFtaqgA== X-Google-Smtp-Source: ABdhPJxjAKbg6F3Yr3YHAbZZriN+Yz3QL6cAYYL3dzJjbIDwYsMO7csuaQ/Vwv/3ugo27Y/TKbI6KA== X-Received: by 2002:adf:fb84:: with SMTP id a4mr5349994wrr.315.1642101575845; Thu, 13 Jan 2022 11:19:35 -0800 (PST) Received: from localhost.localdomain (dynamic-edxzkbgi36x9bhyfb-pd01.res.v6.highway.a1.net. [2001:871:5e:b726:b655:92b8:dc78:787]) by smtp.gmail.com with ESMTPSA id z1sm1113388wrw.95.2022.01.13.11.19.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jan 2022 11:19:35 -0800 (PST) Message-ID: <68331b01ee5ed0d02158747bf0e2d2e4476cbbb8.camel@cybertec.at> Subject: Re: database encoding and collation. From: Laurenz Albe To: "James Pang (chaolpan)" , "pgsql-admin@lists.postgresql.org" Date: Thu, 13 Jan 2022 20:19:34 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-2.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2022-01-12 at 13:31 +0000, James Pang (chaolpan) wrote: > We plan to migrate from Oracle to Postgresql 13, existing Oracle database charaterset WE8ISO8859P1 , > NLS_SORT = BINARY, NLS_COM=BINARY. we want to keep same encoding and collation in Postgresql 13 as Oracle, > so encoding=LATIN1 (Aliases ISO88591), what’s the suggested collation and ctype? Using ‘C’,’POSIX’, or en_US.LATIN1 ? > if using en_US.LATIN1 any impact to indexes and query where like % ? > The OS is Redhat 8, when export NLS_LANG=en_US.LATIN1, LC_COLLATE and LC_CTYPE automatically set to en_US.LATIN1, > and then initdb create database clusters with  collname, collation, ctype all = en_US.LATIN1. I advise against using any encoding other than UTF-8. What are you worried about? For the locale, you can get the same behavior as in Oracle by using "C" or "POSIX" (they are the same). Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com