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 1ntVkC-0004kR-RW for pgsql-general@arkaria.postgresql.org; Tue, 24 May 2022 14:42:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ntVkB-0007Se-Ed for pgsql-general@arkaria.postgresql.org; Tue, 24 May 2022 14:42: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 1ntVkB-0007SU-3c for pgsql-general@lists.postgresql.org; Tue, 24 May 2022 14:42:43 +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 1ntVk8-0000wK-Rd for pgsql-general@postgresql.org; Tue, 24 May 2022 14:42:42 +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 24OEgc9L1543934; Tue, 24 May 2022 10:42:38 -0400 From: Tom Lane To: "David G. Johnston" cc: jian he , "pgsql-general@postgresql.org" Subject: Re: cast to domain with default collation issue. In-reply-to: <1432728.1653370431@sss.pgh.pa.us> References: <1432728.1653370431@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Tue, 24 May 2022 01:33:51 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1543932.1653403358.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 24 May 2022 10:42:38 -0400 Message-ID: <1543933.1653403358@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Perhaps this should be documented more clearly, but it's not obviously > wrong. If the domain declaration doesn't include an explicit COLLATE > then casting to the domain doesn't create an explicit collation > requirement. (That is, the domain *doesn't* have a specific > collation attached to it, any more than type text does.) Perhaps we could improve matters like this? diff --git a/doc/src/sgml/ref/create_domain.sgml b/doc/src/sgml/ref/create= _domain.sgml index 81a8924926..e4b856d630 100644 --- a/doc/src/sgml/ref/create_domain.sgml +++ b/doc/src/sgml/ref/create_domain.sgml @@ -94,7 +94,8 @@ CREATE DOMAIN name [ AS ] An optional collation for the domain. If no collation is - specified, the underlying data type's default collation is used. + specified, the domain has the same collation behavior as its + underlying data type. The underlying type must be collatable if COLLATE is specified. regards, tom lane