Re: cast to domain with default collation issue.
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: jian he <jian.universality@gmail.com>,
"pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
Date: 2022-05-24T14:42:38Z
Lists: pgsql-general
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 <replaceable class="parameter">name</replaceable> [ AS ] <replacea
<listitem>
<para>
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 <literal>COLLATE</literal>
is specified.
</para>
regards, tom lane
Commits
-
Doc: clarify the default collation behavior of domains.
- e0047269a8c9 10.22 landed
- d6d9ea0a468b 13.8 landed
- d26ac35d0d7c 15.0 landed
- cc5de7ba255d 12.12 landed
- be35a6456901 14.5 landed
- a8c63282ddce 11.17 landed