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 1pOoNO-0005db-Uu for pgsql-general@arkaria.postgresql.org; Sun, 05 Feb 2023 23:24:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pOoNN-0000P3-OU for pgsql-general@arkaria.postgresql.org; Sun, 05 Feb 2023 23:24:49 +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 1pOoNN-0000Ou-Dm for pgsql-general@lists.postgresql.org; Sun, 05 Feb 2023 23:24:49 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pOoNH-0000ur-5t for pgsql-general@lists.postgresql.org; Sun, 05 Feb 2023 23:24:49 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 315NOe492550996; Sun, 5 Feb 2023 18:24:40 -0500 From: Tom Lane To: Dionisis Kontominas cc: pgsql-general@lists.postgresql.org Subject: Re: Question regarding UTF-8 data and "C" collation on definition of field of table In-reply-to: References: Comments: In-reply-to Dionisis Kontominas message dated "Mon, 06 Feb 2023 00:08:28 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2550994.1675639480.1@sss.pgh.pa.us> Date: Sun, 05 Feb 2023 18:24:40 -0500 Message-ID: <2550995.1675639480@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dionisis Kontominas writes: > Let's say that the definition is for example as follows: > name character varying(8) COLLATE pg_catalog."C" NOT NULL > and also assume that the database default encoding is UTF8 and also the > Collate and Ctype is "C"". I plan to store strings of various languages in > this field. > Are these the correct settings that I should have used on creation of > the database?. Well, it won't crash or anything, but sorting will be according to byte-by-byte values. So the sort order of non-ASCII text is likely to look odd. How much do you care about that? regards, tom lane